更新时间:2023-12-05 16:45:10
我在 CCBottomRefreshControl 的帮助下找到了一个非常简单的解决方案
你需要就像简单的UIRefreshController一样对待它
I found one very easy solution with help of CCBottomRefreshControl You need to just treat it like simple UIRefreshController
let bottomRefreshController = UIRefreshControl()
bottomRefreshController.triggerVerticalOffset = 50
bottomRefreshController.addTarget(self, action: #selector(ViewController.refreshBottom), forControlEvents: .ValueChanged)
collectionView.bottomRefreshControl = bottomRefreshController
func refreshBottom() {
//api call for loading more data
loadMoreData()
}
和您认为应该停止加载的地方
and where you think you should stop loader simply
collectionView.bottomRefreshControl.endRefreshing()