Post

Replies

Boosts

Views

Activity

Reply to iOS 14 Crash when Reordering Self-Sizing Collection View Cells
I was also having a crash, in iOS 14 only, on a Self Sizing Collection View Cells when calling collectionView.moveItem(at: fromIndexPath, to: toIndexPath). The workaround I've found is to switch estimatedItemSize to CGSize.zero just before and change it back to UICollectionViewFlowLayout.automaticSize after calling moveItem, like this: layout.estimatedItemSize = CGSize.zero collectionView.moveItem(at: fromIndexPath, to: toIndexPath) layout.estimatedItemSize = UICollectionViewFlowLayout.automaticSize This can cause a small glitch in the UI but at least it doesn't crash. Hope this helps someone.
Oct ’20