UITableViewDropDelegate should allow moving multiple items within the same table view

Originator:curtis.clifton
Number:rdar://32854195 Date Originated:19-Jun-2017 11:38 AM
Status:Open Resolved:
Product:iOS + SDK Product Version:11.0 (15A5278f)
Classification:Other Bug Reproducible:Always
 
Summary:
UITableViewDragDelegate supports picking up multiple items and dragging them to a different view or app. The UITableViewDragDelegate and UITableViewDropDelegate tandem support moving a single item within the same table view, as does the classical UITableViewDataSource move API. However, neither mechanism supports moving *multiple* items within the same table view.

Steps to Reproduce:
1. Build and run the attached project on a 12.9” iPad or simulator
2. Pick up multiple items in the sidebar.
3. Drag them elsewhere on the sidebar table view.

Expected Results:
An drop row is opened under the drag. Releasing the dragged items there moves the items within the table view.

Actual Results:
With multiple local items in the drag, the table view forbids dropping.

Version:
11.0 (15A5278f)

Notes:
In the attached project, ViewController.swift implements tableView(_:, canHandle:) -> Bool to return true in the multiple local items case. It also implements tableView(_:, dropSessionDidUpdate:, withDestinationIndexPath:) -> UITableViewDropProposal to return a .move drop proposal. 

It seems that UITableView’s internal UIDropInteraction is disregarding our UITableViewDropProposal in the multiple item case and passing .forbidden to the UIDropSession. (Evidence for this is that removing the UIDragInteraction from UITableView in viewDidLoad allows us to install our own UIDragInteraction whose delegate support multi-item drop.)

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!