Subclass UICollectionViewCell . Override the didMoveToWindow method:
- (void)didMoveToWindow { if (self.window != nil) { // I am now in the window view hierarchy and thus "on screen". } }
Technically, a cell may still not be visible, either because it is outside the visible borders of the window, or because it is covered by another view. But usually this is not so.
Note also that if a cell is reused, it cannot be deleted and re-added to the view hierarchy. A collection view can simply change the frame of a cell. (I know that a UITableView does this with table cells with iOS 6.0.) In this case, you will not receive a didMoveToWindow message when the cell is reused for another element.
If you explain why you want to know when a cell is displayed, we could give you a better answer.
source share