Search code examples
xcodeios6uicollectionviewuicollectionviewcell

UICollectionViewCell will be displayed/ was displayed?


pretty simple question.

Is there a notification or delegate-type method to tell when a UICollectionViewCell object is displayed?


Solution

  • Swift 5:

    override func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
            super.collectionView(collectionView, willDisplay: cell, forItemAt: indexPath)
             // Your code here
        }