Answers for "get index of the top cell in uiCollectionView"

2

UICollectionView current visible cell index

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)
Posted by: Guest on March-24-2020

Code answers related to "get index of the top cell in uiCollectionView"

Code answers related to "Swift"

Browse Popular Code Answers by Language