title: How to animate UICollectionview cells as i scroll
body: <p>How can i animate Horizontal Collectionview as it is scrolled i changed alpha to 0 in the cell and in <code>cellForItemAt</code> i animate the alpha back to 1 but that only happens when the Collectionview is scrolled through the first time here is the code i have tried </p>
  
  <pre><code>UIView.animate(withDuration: 0.8) {
          cell.imageView.alpha = 1
          cell.onboardLabel.alpha = 1
   }
  </code></pre>
  
  <p>I also tried to do this in <code>scrollViewDidEndDecelerating</code> but still not working</p>
  
  <pre><code> let index = Int(scrollView.contentOffset.x) / Int(scrollView.frame.width)
   let indexPath = IndexPath(item: index, section: 0)
   let cell = collectionView.cellForItem(at: indexPath) as? OnboardingCell
  
      UIView.animate(withDuration: 0.8) {
          cell?.imageView.alpha = 1
          cell?.onboardLabel.alpha = 1
      }
  </code></pre>