Answers for "how to get index in collectionview in swift"

1

how to get current shown collectionview cell index in swift

func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
    for cell in yourCollectionView.visibleCells {
        let indexPath = yourCollectionView.indexPath(for: cell)
        print(indexPath)
    }
}
Posted by: Guest on March-24-2020

Code answers related to "how to get index in collectionview in swift"

Code answers related to "Swift"

Browse Popular Code Answers by Language