Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on updateConfiguration method #5

Open
stephenyao opened this issue Mar 5, 2018 · 0 comments
Open

Crash on updateConfiguration method #5

stephenyao opened this issue Mar 5, 2018 · 0 comments

Comments

@stephenyao
Copy link

stephenyao commented Mar 5, 2018

We're using this component and getting the occasional crash upon calling updateConfiguration inside the InfiniteScrollingBehavior class.

The scenario is as we have a vertically scroll UICollectionView where each cell in the collection view contains another collection view that uses the InfiniteScrollingBehaviour class. Each time we deque and reuse a cell we need to call updateConfiguration on the InfiniteScrollingBehavior, and this is where the crash occurs. We can't reproduce it 100% of the time, but it happens frequently enough that it would blow up in production if we were to release it.

I'm suspecting that

DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
    self.collectionView.reloadData()
    self.scrollToFirstElement()
}

is causing the problem. May I ask, why you have used a asyncAfter call, rather than just a async? Also, why do we need to use DispatchQueue.main at all, as the InfiniteScrollingBehavior doesn't perform updateConfiguration on a background queue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant