Get Visible IndexPath UICollectionView in Swift

前端 未结 5 2010
-上瘾入骨i
-上瘾入骨i 2021-02-07 11:02

How to get visible IndexPath while scrolling in collectionView,I referred many link1,link2 But indexPathForCell is not suppor

5条回答
  •  不要未来只要你来
    2021-02-07 11:19

    Have you tried delegate function?

    public func indexPathsForVisibleItems() -> [NSIndexPath]
    

    or

    collectionView.indexPathsForVisibleItems()
    

    these must give you what you wanted.

提交回复
热议问题