Search code examples
swiftxcodeswiftuiuikit

SwiftUI Drag and Drop with a list


Do you know how I can achieve a drag and drop result like in the "reminders" app from Apple using SwiftUI? If not, how could I do a UIViewRepresentable (from UIKit) for a Drag and Drop feature with UIKit for SwiftUI?

Please see the picture below.

Any suggestions would be greatly appreciated.

enter image description here


Solution

  • So far there is not really a boot in method to drag and drop. The .onDrag modifier really only seems to work on the iPad. My suggestion is that you use a UIViewRepresentable and make a table view (UI kit) and then implement the drag and drop from there.