-
Notifications
You must be signed in to change notification settings - Fork 3
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 when adding a section before view appears #8
Comments
Any suggested fix? I kinda get the issue, but I'm not sure off-hand the most appropriate fix. Seems we'd need to know somehow that its 'detached'? Or perhaps I'm misunderstand the issue? |
Is this resolved from the PR I just merged related to |
I tried the change but it didn't fix this. It could be something similar though so worth thinking about. |
As mentioned in #13 and #8 there are some scenarios where the collection view’s data is out-of-sync with the data in composed. As mentioned in #13 calling `layoutIfNeeded` can trigger the data to be in sync again. In this I have added it to `mappingWillBeginUpdating(_:)` which _appears_ to solve the problem. It might be needed in `replace(sectionProvider:)` (because `reloadData` is called) and/or `mappingDidInvalidate(_:)` (for the same reason) but I’m still investigating.
Describe the bug
When adding a section to a
ComposedSectionProvider
in aviewDidLoad
after theCollectionCoordinator
has been set as the delegate but before the view has appeared the coordinator willfatalError
inelementsProvider(for:)
with errorFatal error: No UI configuration available for section 2
.To Reproduce
Expected behavior
Should not crash
Environment
Additional context
The crash is triggered by
collectionView.performBatchUpdates
, but the closure is never executed soprepareSections
never gets a chance to be called.The text was updated successfully, but these errors were encountered: