As of iOS 9, UICollectionView supports interactive movement via beginInteractiveMovement
and its sibling methods. As of iOS 11, it also supports drag and drop, which seems to support movement as well. In iOS 13 beta 4, drag and drop gestures have been combined with UIContextMenuInteraction
animations (Twitter link) so you can transition from a context menu to a drag operation, but the same isn't true when reordering via the interactive movement APIs.
Is it better to implement interactive movement of items in a collection view using drag and drop going forward?
It is better to migrate to UICollectionViewDragDelegate
and UICollectionViewDropDelegate
. I recently had a task where I had to combine context menu, reordering (after activation via context menu) and UICollectionViewCompositionalLayout
with orthogonal sections.
I have to say, that if you use gesture recognizers and interactive movement, it will break scrolling in all orthogonal sections.
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