IGListKit icon indicating copy to clipboard operation
IGListKit copied to clipboard

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

Open Huahuasun opened this issue 4 years ago • 1 comments

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.

Huahuasun avatar Nov 02 '21 10:11 Huahuasun

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

matin0728 avatar Oct 27 '23 06:10 matin0728