Search code examples
iosuicollectionviewuicollectionviewcell

"Shadow insert is nil. File a bug on UICollectionView!" error when drag&dropping a UICollectionViewCell


When I drag & drop a cell in a UICollectionView, sometimes, this crash happens:

Assertion failure in -[_UICollectionViewDragAndDropController _beginDragAndDropInsertingItemAtIndexPath:], _UICollectionViewDragAndDropController.m:615

Shadow insert is nil. File a bug on UICollectionView!

What can I do to prevent it from happening?


Solution

  • Make sure to update your cells properly (using reloadData/insertItems/reloadItems/deleteItems/reloadSections) to reflect any changes in the data source.