Hi, we are experiencing an issue with the latest BETA of iOS 14 (BETA 2). In our app we make use of a collection view and perform animations to move/insert/delete cells int eh collection view. Since iOS 14 our app is experiencing severe crashes when performing such updates. Here is the relevant part of code:
NSMutableArray<NSIndexPath *> *toInsert = [NSMutableArray new];
NSMutableArray<NSIndexPath *> *toRemove = [NSMutableArray new];
NSMutableArray<NSIndexPath *> *toMoveFrom = [NSMutableArray new];
NSMutableArray<NSIndexPath *> *toMoveTo = [NSMutableArray new];
/* FILL THE ARRAYS */
[self.collectionView performBatchUpdates:^{ /* <-- CRASH HERE */
&#9;&#9;if (toInsert.count > 0)
&#9;&#9;&#9;&#9;[self.collectionView insertItemsAtIndexPaths:toInsert];
&#9;&#9;if (toRemove.count > 0)
&#9;&#9;&#9;&#9;[self.collectionView deleteItemsAtIndexPaths:toRemove];
&#9;&#9;if (toMoveFrom.count > 0 &amp;&amp; toMoveFrom.count == toMoveTo.count) {
&#9;&#9;&#9;&#9;for (NSInteger i = 0; i < toMoveFrom.count; i++) {
&#9;&#9;&#9;&#9;&#9;&#9;[self.collectionView moveItemAtIndexPath:toMoveFrom[i] toIndexPath:toMoveTo[i]];
&#9;&#9;&#9;&#9;}
&#9;&#9;}
} completion:nil];
And the crash:
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000008e70aa1b0
We monitor our crash reports with Firebase and it's reported that the crashes happen only on iOS 14 devices. We also received feedback from our BETA testers through TestFlight reporting the same issue.
Any advice?