This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Put this function into the extension of the UICollectionVIewDelegate and you will get the index of the current cell displaying. | |
// This will be helpful when you will implemenet the image slider with the help of the collectionView(by default pagination of the collectionView). | |
func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { | |
print("Currently visible cell is \(self.collectionView.indexPathsForVisibleItems)") | |
} |