I also have the same question and no clue on how to resolve this thus far. The way I see this is that the viewmodel (when working with MVVM) needs to get instantiate below the definition of the WindowGroup, making it unavailable for the .commands modifier. What are we missing here?
Post
Replies
Boosts
Views
Activity
Drag and drop doesn't seem to work on iPhone, just iPads. I'm kinda shy about hierarchical lists using List(_,children:)because I expect move would still allow top level items (my containers) would be allowed to be moved.
I'd argue it's even worse than that: as far as I can tell (having played around with Lists now to achieve what you are looking to achieve) there is no .onMove when the list is built with List(_ data:selection:rowContent:) – the .onMove modifier is as far as I can tell really only available when building out the list with ForEach.
ForEach has no clue of hierarchical items though the way I see it...
Trying to come up with a way to enable the user to move an item to another section I ended up showing buttons for all the sections in contextMenu within ForEach. When clicking one of the buttons, I remove the selected item from one section and append it to the end of the selected section.
Cumbersome, but works... I hope that there will be a more swift solution coming though...