【发布时间】:2018-04-17 12:39:18
【问题描述】:
【问题讨论】:
标签: ios uitableview xcode9
【问题讨论】:
标签: ios uitableview xcode9
UITableViewDataSource 预取将帮助您提高 TableView 的平滑滚动和性能,方法是提前为用户向下滚动时可见的下一行预取数据。
prefetchDataSource 是充当表格视图的预取数据源的对象,接收即将到来的单元格数据需求的通知。
UITableViewDataSourcePrefetching 协议 UITableView 和 UICollectionView 从 iOS 10 开始可用。委托函数 tableView(_ tableView: UITableView, prefetchRowsAt indexPaths: [IndexPath]) 将在行接近显示区域时调用,您可以调用 web API并将它们加载到这个委托函数中。
更多信息请参考:-
https://fluffy.es/prefetching/
https://developer.apple.com/documentation/uikit/uitableviewdatasourceprefetching?language=objc
【讨论】: