SwiftUI Catalyst drag and drop

306 views Asked by At

I'm struggling with implementing drag'n'drop for my SwiftUI catalyst app. This is my code:

Text("Drag your files here")
    .onDrop(of: ["public.url","public.file-url"], isTargeted: nil) { providers -> Bool in
        print("dropped")
        print(providers)
        return true
    }

If I drag a file from the finder on the Label, I'm getting the green plus icon. If I drop it, the output is:

dropped
[]

What am I doing wrong?

0

There are 0 answers