How to use UIDocument in SwiftUI DocumentGroup?

How to use UIDocument in SwiftUI's DocumentGroup?

I was thinking to wrap the UIDocument in a ReferenceFileDocument. However, the ReferenceFileDocument doesn't have a fileURL property, and I can't figure out a way to get it.

Any ideas?
Code Block
DocumentGroup(
newDocument:
{ () -> MyDocumentClass in
return MyDocumentClass() // Create a new document
},
editor:
{ (file: ReferenceFileDocumentConfiguration<MyDocumentClass>) -> FieldViewWrapper in
file.document.url = file.fileURL // Now get the url
ContentView() // View/Edit the document
}
)

How to use UIDocument in SwiftUI DocumentGroup?
 
 
Q