本文介绍了在Swift中获取Visible IndexPath UICollectionView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 collectionView 可见IndexPath 滚动 >,我提到了很多,但是 indexPathForCell

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

推荐答案

您是否尝试过委托功能?

Have you tried delegate function?

public func indexPathsForVisibleItems() -> [NSIndexPath]

collectionView.indexPathsForVisibleItems()

这些必须给你你想要的东西。

these must give you what you wanted.

这篇关于在Swift中获取Visible IndexPath UICollectionView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 10:13