From the diagram above I have UICollectionView
with 4 custom cells. At any time 2 or three cells can be on the screen. How can I tell when \"cell 1\"
You can filter your visibleCells array to check if the frame of your cell is included in the frame of your collectionView:
var visibleCells = self.collectionView?.visibleCells
visibleCells = visibleCells?.filter({ cell -> Bool in
return self.collectionView?.frame.contains(cell.frame) ?? false
})
print (visibleCells)