If I use the following code
NSArray * activityItems = @[tempFileURL];
UIActivityViewController * activityViewController =
[[UIActivityViewController alloc] initWithActivityItems: activityItems
applicationActivities: nil];
[self.parentViewController presentViewController: activityViewController
animated: YES
completion: nil];
Then choose 'Save to Files', I am presented with the following dialog:
I would like to present this dialog without needing to first go though UIActivityViewController
(and the 'save to files' option) first. I haven't been able to find an alternative way to do this. Any suggestions?
Specifically, my question boils down to this:
How can I have a user specify where a file should be saved without going though UIActivityViewController
?
I had same issue. And I found a solution.
You can use UIDocumentPickerViewController
for that purpose.
// in Your ViewController
let viewController = UIDocumentPickerViewController(urls: [tempFileURL], in: .exportToService)
present(viewController, animated: true)
You can get a screen like the following one.
You can see Apple documentation here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With