Description
I have collection node, willBeginBatchFetchWith: works fine until I use filters resulting in fetching just ONE item (with several it's seems ok). After that I reset filters and willBeginBatchFetchWith: doesn't fire anymore. So no new content. But in rare occasions it may fire.
Well, probably I should use more traditional approach with fetching new content when collection node will display last items?
Quite annoying bug I spent two days already testing different behaviour, still no fix.
func collectionNode(_ collectionNode: ASCollectionNode, willBeginBatchFetchWith context: ASBatchContext) {
fetchNewBatchWithContext(context) // after filtering content this is stoped fire again
}
update:
Implemented good old solution:
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let currentOffSetY = scrollView.contentOffset.y
let contentHeight = scrollView.contentSize.height
let screenHeight = UIScreen.main.bounds.size.height
let screenfullsBeforeBottom = (contentHeight - currentOffSetY) / screenHeight
if screenfullsBeforeBottom < 2.5 {
self.fetchNewBatchWithContext(nil)
}
}
At least it works.