在Swift中获取Visible IndexPath UICollectionView [英] Get Visible IndexPath UICollectionView in Swift

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

问题描述

如何在 collectionView 可见IndexPath 滚动 >,我提到了很多 link1 link2 但是 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆