

So you can store the most of the files in other directories outside the users reach and use Documents directory to expose files that may be useful for users to have direct access to. Similarly photo editing app Darkroom has a public directory with a lot of random files which I suspect is unintended.Īlso Documents directory is not the only place to store your app files, just the most common. While working on this post I noticed that app REC for video recording uses this directory to save videos that were taken with the app but user (in this case me), did not choose to save them to Photos. You need to keep in mind that user may delete or edit these files and you app should react accordingly. Or maybe you could expose backups in this way. If maybe you have something like a Markdown editor, then it may make sense to make these files available to the users, so they can easily copy them or open them in another app. I think exposing files like this makes sense for a particular types of apps. Once you enable this, you can open Files app, navigate to the "On My iPhone" section and if you have any files inside Documents directory, you will se directory with your app name with these files inside. This consists of adding two keys to ist and these are: Lazy var documentsURL : URL = () Howĭid you know you can make this directory accessible to users via the Files app? It takes just a little bit of configuration.
