Drag & drop using onDrag
and onDrop
from SwiftUI work really well on iOS devices. However, for macOS, I can't even drag a view at all.
For iOS it works, for macOS it doesn't, which seems very strange. This app was made with Catalyst, with an iOS 13.4 target.
Even for something basic it works on one and not the other:
struct ContentView: View {
var body: some View {
Text("Hello World!")
.onDrag { NSItemProvider(object: "Hello 2" as NSString) }
}
}
What am I doing wrong? Is this a bug?