AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Iwrite apple11/30/2022 ![]() ![]() It seems that what I am trying to find is the Documents directory in my iOS app's sandbox directory (from documentation). IWRITE APPLE HOW TOHow to write files in an iOS app to make them visible to afc protocol? Present(activityViewController, animated: true, completion: nil) 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:, applicationActivities: nil) ![]() ![]() How to save document to Files App in swift If you would like to expose your App document files inside Apple's Files App you need to include the "Supports Document Browser" key in your info plist file and set it to YES: If you would like to expose the files located on your App Bundle's document directory you can check this post How can I display my App documents in the Files app for iPhone How can I display my App documents in the Files app for iPhone Return (try? resourceValues(forKeys: ))?.localizedName Return (try? resourceValues(forKeys: ))?.typeIdentifier appendingPathComponent(response?.suggestedFilename ? "fileName.csv") Struct DocumentInteractionController: UIViewControllerRepresentable So if you are working with SwiftUI this gets a bit more complicated than the regular Storyboard approach as you can see in this post because you need to implement UIViewControllerRepresentable for UIDocumentInteractionController: You can use a UIDocumentInteractionController and ask the user to choose the location where the file is supposed to be written. How can I write a file in a folder located at Apple's Files App in SwiftUI?Īs I have already posted in comments you can NOT programmatically save a file out of your APP Bundle. ![]()
0 Comments
Read More
Leave a Reply. |