UIDropOperationMove behavior is ignored when there are multiple items in the dragging session

Number:rdar://42068699 Date Originated:11-Jul-2018 08:20 AM
Status:Open Resolved:
Product:iOS + SDK Product Version:11.4
Classification:Enhancement Reproducible:Always
This radar is in the context of UICollectionView.

When dealing with Drag & Drop on iOS 11 and above, you can respond to a drop session by returning a drop proposal. You can customize the recipient behavior assigning a drop operation to the drop proposal returned.

If you instantiate, for instance, a drop proposal with UIDropOperationMove as its drop operation and UICollectionViewDropIntentInsertAtDestinationIndexPath as its intent, you can expect the collection view to completely lift the dragging view (removing its original tile from the collection view) and open a gap where item could be dropped.

This is expected behavior. However, this does not happen when there are multiple items in the session. 

Configuring another drop proposal with the same values as stated before, but for a drop session that has multiple items in it, the drop interaction actually behaves as if the drop proposal was configured with UIDropOperationCopy as its operation, lifting only previews for the items to drag (but leaving the "blueprint" in place), and not opening gaps in the collection view for items to be dropped.

As far as I've been able to test, a drop session with multiple items only lets you perform the drop _outside_ the source application.

I verified and an implementation of `- collectionView:dragSessionAllowsMoveOperation` returning `YES` _is_ called but the resulting behavior is still that of a UIDropOperationCopy-assigned drop proposal.

Steps to Reproduce:
- Download the attached sample project, and run.
- Tap and hold one item on the collection view to initiate a dragging session
- Once the item has lifted, move that item around and place at another spot in the collection view.

- Lift another item, but this time add more items to it by tapping them.
- Once you have 2 or more items in the session, try to reorder them.

Expected Results:
A drop proposal configured with UIDropOperationMove behaves the same way when the drop session has one or multiple items.

Actual Results:
A drop proposal configured with UIDropOperationMove behaves correctly when the session has only one item, but as UIDropOperationCopy when the drop session has multiple items in it.


Attached to this radar you can find a sample project with the minimal configuration required to expose the behavior, as well as a video demonstrating the code running on an iPad Pro (9.7) running iOS 12b3.

Related: rdar://42031700


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!