Open achan opened 6 years ago
My best guess to what's going on is that the target offset after scrolling finished is relative to the content size before the page finishes loading. Then the load finishes before the scrolling animation is done, but the resting offset has already been determined. So your new content loads but the scrolling just ends.
One idea to fix this is to make your loading trigger distance way larger (on Instagram its like 2x your screen height, pretty large).
@achan Did you find a solution? I have the same problem.
@rnystrom I often get stuck when scrolling very quickly and adding new objects
model.append(contentsOf: newElements)
listAdapter?.performUpdates(animated: false, completion: nil)
I did not, @szubiszon. It was a side-project that eventually got dropped 😢
I've solved this issue by using
let oldItem = model.items
olditem.append(newItems)
model.items = olditem
//then
listAdapter?.performUpdates(animated: false, completion: nil)
New issue checklist
README
and documentationGeneral information
IGListKit
version:Debug information
I'm still new to IGListKit so forgive me if I have this all wrong.
In two separate apps, one developed by me and another developed by a co-worker, we've seen scrolling inertia abruptly stop when trying to load more items to our
UICollectionView
(a la infinite scroll).They're both implemented similarly to this:
Where
loadMore()
is ultimately performing a network request, converting the request intoListDiffable
view models, appending to the data source and telling theadapter
to perform updates.UICollectionViewController
:View Model
:I've played around with moving loadMore() to a background thread with similar outcome, though I believe network requests from URLSessionDataTask do that automatically?
Here's a screen capture of the bug in action. I've added a print statement for emphasis.
Thanks for your time and all the hard work on this library 👏