Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift Drag&Drop - Move multiple items at once within the same collectionView

I'm currently trying to implement Drag&Drop in my app. I've watched this:

https://developer.apple.com/videos/play/wwdc2017/223/

(There's also a downloadable project that exactly showcases what I'm about to ask)

There's one thing I don't understand and that's this:

enter image description here

When I drag one item, I can drop it within the same collection view. However, that's not working anymore when I drag multiple items. No "gap" is created and when I drop the items, they just go back to their old positions.

Does this have any specific reason I'm not seeing? Because I'd love to have this feature.

I mean, I probably could implement the actual "moving the data" part (it's just a case that the demo project is not considering), but I see no way of adding this "gap" while hovering over the items.

Thanks for any advice :)

like image 751
Quantm Avatar asked Oct 17 '25 16:10

Quantm


1 Answers

This is currently not supported with the latest set of APIs (as of iOS 13). It's possible to do by returning a proposal with intent .unspecified and drawing a drop indicator manually.

See tweet reply from Tyler Fox, Apple engineer.

like image 157
simme Avatar answered Oct 19 '25 06:10

simme