Drag and drop between collection views with UICollectionViewDiffableDataSource throws assertion failure

I'm using the

UICollectionView
drag and drop API to drag cells between collection views as well as within the same collection view.

This works as expected when dragging a cell within its original collection view, however, when I drag this cell over another collection view I get the following:

... *** Assertion failure in -[UICollectionView _updateRowsAtIndexPaths:updateAction:updates:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore_Sim/UIKit-3901.4.2/UICollectionView.m:6265

Event with its simplest implementation for

dropSessionDidUpdate:
this happpens:
func collectionView(_ collectionView: UICollectionView, dropSessionDidUpdate session: UIDropSession, withDestinationIndexPath destinationIndexPath: IndexPath?) -> UICollectionViewDropProposal { return .init(operation: .move, intent: .insertAtDestinationIndexPath) }

This always happens when the operation is

.move
or
.copy
.

to my understanding this should "just work" and

dropSessionDidUpdate:
should provide nice visual feedback about the potential drop here.

It's worth also noting the collection views all use the same code (each a UICollectionViewController of the same type).


Update 1

This seems to "work" when returning

.init(operation: .move)
without the
intent
parameter. Although there are no animations, the data is moved and the collection view updated...


Update 2

As above, this also works when returning

.init(operation: .move, intent: .insertIntoDestinationIndexPath)
or
.init(operation: .move, intent: .unspecified)
. There are no suggestive animations but the content is dropped successfully.
Post not yet marked as solved Up vote post of Adamc93 Down vote post of Adamc93
741 views