I am trying to use a drag delegate and drop delegate to rearrange rows in a UITableView. This is instead of using the edit-mode and move-handles that invoke the the moveRowAt of UITableViewDataSource.
The use of the drag delegate and drop delegate to accomplish this works great when running on iOS, but not on mac running via Catalyst.
What I see:
I'm not sure what else I can do to make the UITableView happy if this functionality already works on iOS.
The tableview is configured like:
This is my final blocker before releasing a catalyst app for 10.15, and I would like to get it resolved before 10.16.
FB7737498 is filed to capture this behavior and has a sample project attached.
If there is an acceptable project host for the new forum, I can attach it here as well.
The use of the drag delegate and drop delegate to accomplish this works great when running on iOS, but not on mac running via Catalyst.
What I see:
Code Block tableView(_ tableView: UITableView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath)
is called.Code Block tableView(_ tableView: UITableView, canHandle session: UIDropSession) -> Bool
is not called. I'm not sure what else I can do to make the UITableView happy if this functionality already works on iOS.
The tableview is configured like:
Code Block tableView.dragDelegate = self tableView.dropDelegate = self tableView.dragInteractionEnabled = true
This is my final blocker before releasing a catalyst app for 10.15, and I would like to get it resolved before 10.16.
FB7737498 is filed to capture this behavior and has a sample project attached.
If there is an acceptable project host for the new forum, I can attach it here as well.
So I made it past this. The fix is "Weird" to say the least. It appears that an NSItemProvider constructed without an object will cause drop handlers to be invoked, despite a localObject being present on the UIDragItem.
I also seemed to have an issue with custom-type-dentifiers like "com.john.forum.post" not triggering drop handlers either.
If I put a standard NSString in the NSItemProvider it worked fine.
Given I was only using the localObject, I put an acceptabl user facing string in the NSItemProvider, and drag and drop worked fine for me on catalyst.
I also seemed to have an issue with custom-type-dentifiers like "com.john.forum.post" not triggering drop handlers either.
If I put a standard NSString in the NSItemProvider it worked fine.
Given I was only using the localObject, I put an acceptabl user facing string in the NSItemProvider, and drag and drop worked fine for me on catalyst.