Fix drag and drop targeting bugs.

This commit is contained in:
Maurice Parker
2019-11-22 19:59:25 -06:00
parent dd7431d5cb
commit c8cfcae8e3
2 changed files with 12 additions and 7 deletions

View File

@@ -26,8 +26,12 @@ extension MasterFeedViewController: UITableViewDropDelegate {
return UITableViewDropProposal(operation: .forbidden)
}
if destNode.representedObject is Folder && session.location(in: destCell).y >= 0 {
return UITableViewDropProposal(operation: .move, intent: .insertIntoDestinationIndexPath)
if destNode.representedObject is Folder {
if session.location(in: destCell).y >= 0 {
return UITableViewDropProposal(operation: .move, intent: .insertIntoDestinationIndexPath)
} else {
return UITableViewDropProposal(operation: .move, intent: .unspecified)
}
} else {
return UITableViewDropProposal(operation: .move, intent: .insertAtDestinationIndexPath)
}