In SwiftUI on Xcode 12.1 both on iOS and macOS when dragging an object to an empty list, there's an internal crash in [UITableViewRowData numberOfRowsInSection:] () and no command line output.
Even if I try to handle the drop with .onInsert(...) on the List, it still crashes. (The onInsert closure is never called)
Here's the minimal example to reproduce:
struct ContentView: View {
let string = "Hello World"
var body: some View {
HStack {
Text(string) // Object to drag
.onDrag({NSItemProvider(object: string as NSString)})
List {} // When dragging object onto here, there's a crash
}
}
}
What am I doing wrong?
