Post

Replies

Boosts

Views

Activity

Swift UI DocumentGroup: write to FileWrapper and name document
How can I set a name for a new document which was just created after calling the write method from the FileDocument's protocol ?. I tried to use the properties from the FileWrapper class like '.filename': func write(to fileWrapper: inout FileWrapper, contentType: UTType) throws {         let data = text.data(using: .utf8)!         fileWrapper = FileWrapper(regularFileWithContents: data)         //fileWrapper.filename = "newName"          //fileWrapper.preferredFilename = "newName"     }
2
0
1.3k
Jul ’20