I want to implement standard Save As dialog in mac catalyst app. It should behave as in TextEdit - open a dialog, let user choose location and file format, and create file after clicking Save.
I have found UIDocumentPickerViewController , but I don't know:
You’re on the right lines with UIDocumentPickerViewController
, but you must provide a URL and use UIDocumentPickerViewController(forExporting urls: [URL])
.
To get the URL, write the file data to the temporary directory, then pass the temporary URL as the argument.