Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

how to get current shown collectionview cell index in swift

let visibleRect = CGRect(origin: collectionView.contentOffset, size: collectionView.bounds.size)
let visiblePoint = CGPoint(x: visibleRect.midX, y: visibleRect.midY)
let visibleIndexPath = collectionView.indexPathForItem(at: visiblePoint)
 
PREVIOUS NEXT
Tagged: #current #shown #collectionview #cell #index #swift
ADD COMMENT
Topic
Name
7+3 =