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

UICollectionView performBatchUpdates can trigger a crash if the collection view is flagged for layout #27

Closed
DenTelezhkin opened this issue Jul 12, 2017 · 1 comment
Assignees

Comments

@DenTelezhkin
Copy link
Owner

DenTelezhkin commented Jul 12, 2017

There's is a known issue with UICollectionView, that crashes application if reloadData call was sent prior to performBatchUpdates method.

Radar: https://openradar.appspot.com/28167779

Sample: https://github.com/PSPDFKit-labs/radar.apple.com/tree/master/28167779%20-%20CollectionViewBatchingIssue

Known workarounds - in terms of DTCollectionViewManager:

  • Do not call reloadData method manually, use other methods on MemoryStorage or CoreDataStorage
  • Try to group updates into single update block vs calling many blocks all at once - If needed drop to SectionModel level of abstraction.
  • You can implement your own CollectionViewUpdater, that calls reloadData instead of calling performBatchUpdates, however this will cost you animations, that will not be performed.

Any help or ideas how to implement maintainable solution are welcomed!

@DenTelezhkin
Copy link
Owner Author

Pushed 6.1.0-beta.1 release, that hopefully resolves this issue 🎉 .

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

No branches or pull requests

1 participant