Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

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)
    }
}
 
PREVIOUS NEXT
Tagged: #current #shown #collectionview #cell #index #swift
ADD COMMENT
Topic
Name
7+6 =