我知道在使用new UITableViewDropDelegate和UITableViewDragDelegatedelegates 时可以一次重新排序单个项目/单元格,但是是否可以支持处理多个项目/单元格.
放下牢房就把它放进去了.
然而,当我抓住多个单元格时,我得到了无条目符号,并且单元格不会重新排序:

如果我来自另一个应用程序的多个项目,它可以正常工作,例如从iMessage中拖出多个消息:

是否可以在仅使用本地项目重新排序表格视图时执行此操作,以便您可以更快地重新排序?
这是我的代码:
UITableViewDragDelegate
extension DotViewController: UITableViewDragDelegate {
func tableView(_ tableView: UITableView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) -> [UIDragItem] {
return [getDragItem(forIndexPath: indexPath)]
}
func tableView(_ tableView: UITableView, itemsForAddingTo session: UIDragSession, at indexPath: IndexPath, point: CGPoint) -> [UIDragItem] {
return [getDragItem(forIndexPath: indexPath)]
}
func getDragItem(forIndexPath indexPath: IndexPath) -> UIDragItem {
// gets the item
}
}
Run Code Online (Sandbox Code Playgroud)
UITableViewDropDelegate
extension DotViewController: UITableViewDropDelegate {
func tableView(_ tableView: UITableView, canHandle session: UIDropSession) -> Bool …Run Code Online (Sandbox Code Playgroud)