Post

Replies

Boosts

Views

Activity

Reply to SwiftUI onDrag not showing preview image when running on device
Thanks for your comment. The loadObject function of the NSItemProvider returns a Progress element which you can use to display a progress to the user while the item is loaded. I skipped that in this example. Your code crashes, because you need to declare your variable as a @State var, when the variable affects swiftui code and you want to change it in runtime. Coming back to my initial question, do you also have the issue, that you see the image if you drag running the simulator, but when running on a real device, you only see a transparent rect as preview image?
Jul ’20