title: Check if cell completely displayed in collectionview
body: <p>I have a collection view where the cell is of the size exactly to the collectionView, so each cell should occupy the whole screen. I have implemented a functionality where the cell is snapped to the complete view whenever it's dragged or decelerated through the scroll. This is how the UX works.</p>
  
  <p><a href="https://drive.google.com/open?id=1v8-WxCQUzfu8V_k9zM1UCWsf_-Zz4dpr" rel="noreferrer">https://drive.google.com/open?id=1v8-WxCQUzfu8V_k9zM1UCWsf_-Zz4dpr</a></p>
  
  <p>What I want:</p>
  
  <p>As you can see from the clip, the cell snaps to the whole screen. Now, I want to execute a method after it snaps. Not before or not when it's partially displayed. </p>
  
  <p>Following is the code I have written for snapping effect :</p>
  
  <pre><code>func scrollToMostVisibleCell(){
      let visibleRect = CGRect(origin: collectionView.contentOffset, size: collectionView.bounds.size)
      let visiblePoint = CGPoint(x: visibleRect.midX, y: visibleRect.midY)
      let visibleIndexPath = collectionView.indexPathForItem(at: visiblePoint)!
      collectionView.scrollToItem(at: visibleIndexPath as IndexPath, at: .top, animated: true)
      print("cell is ---&gt; ", visibleIndexPath.row)
  }
  
  
  
  func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
      scrollToMostVisibleCell()
  }
  
  func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
      scrollToMostVisibleCell()
      if !decelerate {
          scrollToMostVisibleCell()
      }
  }
  </code></pre>
  
  <p>If I use <code>willDisplayCell</code> method, then it' just going to return me as soon as the cell is in the view, even if it's just peeping in the <code>collectionView</code>.</p>
  
  <p><strong>Is there a way where I can check if the cell is completely in the view and then I can perform a function?</strong> </p>
  
  <p>I have scrapped the internet over this question, but ain't able to find a satisfactory answer.</p>