title: Check if UITableViewCell is completely visible for automatic playback
body: <p>I'm building a social media app that has a feed of posts. It's required to start playback of assigned track to a post when a post is fully visible on a screen. This is a lay out I have now. </p>
  
  <p><a href="https://i.stack.imgur.com/K4Hrl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K4Hrl.png" alt="Current layout, 2 items visible"></a> </p>
  
  <p>This is a piece of code I figured out, but it only works with a very first post in a timeline.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>func scrollViewDidScroll(_ scrollView: UIScrollView) {
      
      let visibleCell = tableView.visibleCells.first as! HomeControllerTableViewCell
      
      
      let firstCellVisibleIndexPath = tableView.indexPathsForVisibleRows?.first
    
      
      if tableView.bounds.contains(tableView.rectForRow(at: firstCellVisibleIndexPath!)){
        let fullyVisibleCell = tableView.cellForRow(at: firstCellVisibleIndexPath!) as! HomeControllerTableViewCell
        
        print(fullyVisibleCell.authorNameLabel.text)
        
      }
      
    }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Please help me figure out how to determine what cell is fully visible.</p>