I use drag and drop to rearrange a collectionView. When I start the drag, I change the collectionView visualization. To change it back I need a method which will be executed in any case. Now if I start the drag and release the touch immediately, none of the following methods are executed:
not this:
func collectionView(_ collectionView: UICollectionView, dragSessionDidEnd session: UIDragSession)
not this:
func collectionView(_ collectionView: UICollectionView, dropSessionDidEnd session: UIDropSession)
not this:
func collectionView(_ collectionView: UICollectionView, performDropWith coordinator: UICollectionViewDropCoordinator)
Thank you.
From the WWDC "Introducing Drag and Drop" video it seems that the right place to handle the lift and its cancellation is the dragInteraction(_:willAnimateLiftWith:session:)
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With