5

Is it possible to reorder the items inside the LazyVGrid using drag and drop?

Like something similar to the Editmode when using a List together with .onMove()?

Thanks!

davidev
  • 7,694
  • 5
  • 21
  • 56
Kai Zheng
  • 6,640
  • 7
  • 43
  • 66
  • 1
    Posted demo solution in https://stackoverflow.com/questions/62606907/swiftui-using-ondrag-and-ondrop-to-reorder-items-within-one-single-lazygrid – Asperi Aug 16 '20 at 15:21

1 Answers1

2

According to an Apple Engineer:

That's not built-today, though you can use the View.onDrag(_:) and View.onDrop(...) to add support for drag and drop manually.

Do file a feedback request if you'd like to see built-in reordering support. Thanks!

So unfortunately we are on our own here. :/

Have you tried this? SwiftUI | Using onDrag and onDrop to reorder Items within one single LazyGrid?

backslash-f
  • 7,923
  • 7
  • 52
  • 80
  • 2
    It's funny how all of these questions you mentioned are mine haha. I have tried this, I didn't succeed, however, Asperi has, see https://stackoverflow.com/questions/62606907/swiftui-using-ondrag-and-ondrop-to-reorder-items-within-one-single-lazygrid – Kai Zheng Aug 22 '20 at 03:11
  • Haha! Thanks for the link! – backslash-f Aug 22 '20 at 08:59