Dropping an item on itself freezes UIDragSession in UICollectionView when using Mac Catalyst

I have a pretty standard UICollectionView with drag and drop in iOS that is working as intended. After converting to a Mac app using Mac Catalyst, however, the very first time a dragged item is dropped on itself (let's call it at indexPath X), performDropWith is not called, and following happens:

1) UIDragSession seems to be frozen, such that any new drag session will have the destination indexPath fixed to X

2) UIDragSession is not recreated for next drags, and you can check it by looking at the memory address of the session

This behavior is only seen on the Mac Catalyst version of the app and the iOS app properly deallocates the drag session and creates a new one regardless of the drop location of the item.

I'm using Xcode version 12.0 and swift version 5.0

Thanks,
Behrang

Replies

I'm also having issues with drag session in UICollectionView in MacCatalyst, but I'm on macOS 10.15.7 and Xcode 11. I'm curious to see if this turns out to be bugs in catalyst or maybe some booking keeping we forgot to do to terminate failed drags, which also triggers the bug I'm seeing. My bug is very similar, which is that I have two UICollectionView's and items are dragged from one to the other. Once the user starts a drag which passes over the second collection view but does not end up dropping the item into the 2nd view, subsequent drags start but new index paths are never provided to my delegate methods. I do get call backs that the drag enters the 2nd collection view, but there is no movement of the items aside to provide space for the drops, and when dropSessionDidUpdate is called, the destination index path is always nil. I think whatever is causing your bug may be very closely related to what's causing mine. (And it's extra frustrating because I've spent a year re-writing my mac app in catalyst to provide a better drag & drop experience! and instead it just breaks and never works again.)
I think this is a UICollectionView bug which may be fixed in Big Sur.
same issue.
In macOS 11, all perfect, in macOS 10.15 bug fired.
How to handle it in macOS 10.15?
It's fixed in Big Sur.