UIDropProposal with UIDropOperationMove behaves as UIDropOperationCopy on real device

Originator:oscar
Number:rdar://42031700 Date Originated:10-Jul-2018 01:07 PM
Status:Closed Resolved:Fixed on iOS 12b5
Product:iOS + SDK Product Version:12 beta 3
Classification:Serious Bug Reproducible:Always
 
Summary:
Running the same code on a physical iPad Pro (9.7) on iOS 12.3, when returning the `UICollectionViewDropProposal` from `-collecitonView:dropSessionDidUpdate:withDestinationIndexPath` with a drop operation `UIDropOperationMove` and an intent `UICollectionViewDropIntentInsertAtDestinationIndexPath`, the actual drop session behaves as if the operation was set to `UIDropOperationCopy`. That is, the source collection view item is not removed from the collection view during the dragging session, but a gap _is_ opened where the drop would be performed.

Since it seems the collection view is still keeping track of the dragging item locations, the drop session destination indexpath is often out of bounds in relation with the data source behind the collection view, causing a crash when the drop is perfomed.

Correct behavior would be that the source item would be "removed" from the collection view, and the gap opened where the drop would be occurring.

I have only been able to reproduce this 100% of the time when running the code on a real device (iPad Pro 9.7, iOS 12b3). On an iPad Pro 9.7 iOS 12b3 simulator, it _sometimes_ behaves correctly, and sometimes shows the same behavior as the real iPad one.

On an iPad Pro 10.5 iOS 12b3 simulator, this does not happen, and UIDropOperationMove behaves as expected, removing the source item from the collection view and opening a gap where the drop is going to be dropped.

I've also seen the behavior on iOS 11.4 sporadically, but it seems to have been corrected after setting `precise = YES` on the drop proposal returned from `-collectionView:dropSessionDidUpdate:withDestinationIndexPath` and setting the reordering cadence to immediate. I can't deterministically reproduce this on iOS 11.4 or any of the iOS 12 simulators, only on the iPad 9.7 _actual_ device. See the attached sample project.

Steps to Reproduce:
- Open the attached Xcode project and run.
- Initiate a dragging session from one of the red squares.

Expected Results:
The dragging behaves as UIDropOperationMove, not UIDropOperationCopy.

Actual Results:
The dragging behaves as UIDropOperationCopy instead of UIDropOperationMove.

Version:
12 beta 3

Notes:
I've attached a sample project that demonstrates this behavior. The folder includes a video of the demonstration of this bug on an actual iPad (9.7, iOS 12b3).

Comments


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!