Created
February 19, 2018 20:30
-
-
Save radianttap/c06445d8cd24ed636a4f12fe5370a0c5 to your computer and use it in GitHub Desktop.
Why the hell this crashes in UICollectionView?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let expandedSections = [0, 3, 8] | |
let indexSet = IndexSet(expandedSections) | |
collectionView?.performBatchUpdates( | |
{ | |
[unowned self] in | |
if isInserted { | |
self.collectionView?.insertItems(at: indexPaths) | |
} else { | |
self.collectionView?.deleteItems(at: indexPaths) | |
} | |
if !indexSet.isEmpty { | |
self.collectionView?.reloadSections(indexSet) | |
} | |
}, completion: { | |
_ in | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi I'm facing the same issue using framework for CollectionView well that is weird.
Thanks for posting the reason why it happens.
Although i did not understand fully why this is happening.
My only hint is that somehow indexSet is over-floating.