1

on iOS 16 beginInteractiveMovementForItem in collectionvView throws an error:

attempt to insert nil object from objects[0]' terminating with uncaught exception of type NSException

This is my code:

collectionView.beginInteractiveMovementForItem(at: selectedIndexPath)

Is there any alternative on iOS 16 to use? There is another question similar here: UICollectionView crash when moving items on iOS 16 beta but still no answer for this issue.

1 Answers1

2

Simply by adding a delay it works now on iOS 16 as well.

DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
      collectionView.beginInteractiveMovementForItem(at: selectedIndexPath)
}