IGListKit-powered UICollectionView stops scrolling when `performUpdates(:)` gets called

556 Views Asked by At

I am currently experiencing an issue where as the user scrolls an IGListKit powered UICollectionView, the scrolling abruptly stops when listAdapter.performUpdates(:) gets called.

Without getting into too much detail, the ListAdapterDataSource is checking an Interstellar-powered observable property's value for the collection view objects. The view controller that hosts the ListAdapter is also subscribing to this property and issues a performUpdates(:) when the value changes.

I am utilizing scrollViewWillEndDragging(:) similarly to the IGListKit Examples, to trigger a page-fetch network operations when the user approaches the end of the list. That operation updates the observable property with the latest items when it finishes.

My problem is that in the exact same moment where the network operation finishes and updates the observable property (thus triggering a performUpdates(:)), the scrolling stops to a halt. This happens even if the old objects dataset is exactly as the new one (confirmed with manually diffing) when the are no more results/pages to fetch,

Any suggestions on how to debug this? Maybe a certain symbolic breakpoint on some method that could indicate what causes the UICollectionView's scrolling to stop?

1

There are 1 best solutions below

0
Pavel Vavilov On

Not sure it is still actual to you @tannos , but I'll leave it here if anything will face the same issue as you and me does. As it was mentioned in comments by @danqing, this is because of the UIRefreshControl.

So, something like

if refreshControl.isRefreshing {
    refreshControl.endRefreshing()
}

can save your day :)