Swift 4 UICollectionView detect end of scrolling

前端 未结 5 1547
野趣味
野趣味 2021-02-04 13:13

I have an Horizontal UICollectionView on my app and I want to load more data when the user reaches the end (or nearly to the end) of UICollectionView w

5条回答
  •  后悔当初
    2021-02-04 13:53

    Add this in your collectionView willDisplayCell delegate

    if (indexPath.row == dataSource.count - 1 ) {
     //it's your last cell
    
    //Load more data & reload your collection view
      }
    

提交回复
热议问题