Unable to load items from server on CollectionView Scroll end

I am trying to make an api call to fetch contents from server, when collection view is about to end scrolling.
I plan to override
override func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
if indexPath.row == array.count - 1 {
getNextSetOfData()
}
}
this function of UICollectionView. How do I find out the protocol which is responsible to make this function work?
I have delegates for collection.delegate, collection.dataSource, collection.UICollectionViewDelegateFlowLayout set and protocols implemented, but when I try to override func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath), an error pops up - “Method does not override any method from its superclass”

Please delete this question. I figured out, had to delete override to make it work

I’ll close this topic

This topic was automatically closed after 166 days. New replies are no longer allowed.