I think you misunderstand the purpose of FileRepresentation. I know I did. It is not for dragging file objects, it is for storing drag data in a file rather than memory.
This works for me on macOS for dragging between apps. It's missing something to work with the Finder though.
DataRepresentation(exportedContentType: .fileURL) { item in
let url = URL(string:"test")!
return url.absoluteString.data(using: .utf8)!
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: