Hi, I found a problem for method -[IGListAdapterUpdater performBatchUpdatesWithCollectionView:]
New issue checklist
- [yes] I have reviewed the
READMEand documentation - [yes] I have searched existing issues and this is not a duplicate
- [yes] I have attempted to reproduce the issue and include an example project.
General information
-
IGListKitversion: 3.4.0 - iOS version(s): 15.1
- CocoaPods/Carthage version:
- Xcode version: 13.1
- Devices/Simulators affected:
- Reproducible in the demo project? (Yes/No):
- Related issues:
When my collectionView isn't in a visible view, I find when I call the method -[IGListAdapter performUpdatesAnimated:completion:] in another view controller, My collection view's delegate method -[collectionView:willDisplayCell:forItemAtIndexPath:] was called, so I read the source code and find these codes in the file-IGListAdatperUpdater.m.
// if the collection view isn't in a visible window, skip diffing and batch updating. execute all transition blocks, // reload data, execute completion blocks, and get outta here const BOOL iOS83OrLater = (NSFoundationVersionNumber >= NSFoundationVersionNumber_iOS_8_3); if (iOS83OrLater && self.allowsBackgroundReloading && collectionView.window == nil) { [self _beginPerformBatchUpdatesToObjects:toObjects]; reloadDataFallback(); }
when I annotate these codes, this problem is solved.So I am curious, why do reloadDataFallback() be executed directly when collectionView is not visible, sry for my English.
I guess that the batch update method which leads to corresponding animations is not valid for view without a window.