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"
}
Selecting any option will automatically load the page