I just created a PDF document in my app and I want to save the document on the device in a way that the "Files" app can access the saved document.
When you download a PDF document in Safari there is an option to save the document to the "Files" app, which is what I'm trying to do.
I Googled for several hours but wasn't able to find any useful methods.
Tap Move to transfer items to another cloud storage device or your iPad. Tap the destination and then tap the folder (if available). Tap Copy to move the file. The files are copied to the destination.
File -> Save saves the current file, which is the one in the currently active editing pane. You can hold down the Option key when choosing from the File menu to save all files that have changes. (The default key equivalents are Command-S and Command-Option-S.)
LSSupportsOpeningDocumentsInPlace. A Boolean value indicating whether the app may open the original document from a file provider, rather than a copy of the document.
If you have access to your PDFdata
then you could present the user with a UIActivityViewController
where they can then save it to Files
, or share it with any of the other available options:
let activityViewController = UIActivityViewController(activityItems: ["Name To Present to User", pdfData], applicationActivities: nil) present(activityViewController, animated: true, completion: nil)
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