While I’m able to use the fileExporter()
modifier to export in-memory documents, i.e. single file document (.txt
, .jpg
, …) and also for custom file types (after registering them in the project settings with specific UTType
), I can’t figure out how to use that modifier to export/save a package document.
I have an unified iOS/macOS app tha use a project.json
in addition to user selected files. My custom package document folder looks something like this:
/Users/xyz/somefolder/MyAppFile.myfile
----- project.json
----- file001.mp4
----- file002.jpg
----- file003.mp3
----- etc, etc...
FileDocument
protocol asks for Data
when saveing, that is correct when you need to export a single file, but not when you need a folder in which you save and copy file during normal App usage.