Collection view bulk animation crash

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:

Code Block objc
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 */
if (toInsert.count > 0)
[self.collectionView insertItemsAtIndexPaths:toInsert];
if (toRemove.count > 0)
[self.collectionView deleteItemsAtIndexPaths:toRemove];
if (toMoveFrom.count > 0 && toMoveFrom.count == toMoveTo.count) {
for (NSInteger i = 0; i < toMoveFrom.count; i++) {
[self.collectionView moveItemAtIndexPath:toMoveFrom[i] toIndexPath:toMoveTo[i]];
}
}
} completion:nil];


And the crash:

Code Block
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?

I'm seeing the same issue but I haven't found a way to resolve it yet.
Same issue in beta 4
I confirm this is still happening on BETA 4

I confirm this is still happening on BETA 4

Has anyone filed a bug about this? If so, please post your bug number.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
I filed a bug. The feedback ID is FB8277877
Is still happening on BETA 6. Seems the problem is in moveItemAtIndexPath.
This only happens when collectionViewFlowLayout.estimatedItemSize is not zero.
This is a known issue in iOS 14.0, but it should be fixed in the iOS 14.2 beta published this week.
Collection view bulk animation crash
 
 
Q