Quick use to save to iCloud WITHOUT using UIActivityViewController

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 select "Save to Files", I will be presented with the following dialog:

Save to files

I would like to introduce this dialog box without having to first migrate UIActivityViewController(and "save to file"). I could not find an alternative way to do this. Any suggestions?

In particular, my question boils down to the following: How can I tell the user where the file should be saved, if not UIActivityViewController?

+6
source share
1 answer

I had the same problem. And I found a solution.

UIDocumentPickerViewController .

// in Your ViewController
let viewController = UIDocumentPickerViewController(urls: [tempFileURL], in: .exportToService)
present(viewController, animated: true)

, .

Apple .

0

All Articles