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

Hi, I found a problem for method -[IGListAdapterUpdater performBatchUpdatesWithCollectionView:] #1543

Open
Huahuasun opened this issue Nov 2, 2021 · 1 comment

Comments

@Huahuasun
Copy link

Huahuasun commented Nov 2, 2021

New issue checklist

  • [yes] I have reviewed the README and 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

  • IGListKit version: 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.

@matin0728
Copy link

I guess that the batch update method which leads to corresponding animations is not valid for view without a window.

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

2 participants