ios_app_layout_2xWhen you create a new iOS application on your Mac, the operating system installs it in a sandbox directory, which contains the application bundle directory and three additional directories, Documents, Library, and tmp. The application’s sandbox directory, often referred to as the home directory, can be accessed via code or Finder.

By the way, the OS used to create the application sandbox in this directory, on your Mac’s hard drive:

~/Library/Application/iPhone Simulator

Now, it is created in this directory:


Accessing The App Documents Folder Via Code

Now, to retrieve and display the full path to an application’s Documents directory, you’d have to add this code snippet in a Swift file’s function; for example, the viewDidLoad() function.

let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true) as NSArray
let documentsDir = paths.firstObject as String
println("Path to the Documents directory\n\(documentsDir)")
Code Output
Path to the Documents directory
Accessing The App Documents Folder Via Finder

Now that you’ve gotten the full path to the application’s Documents folder. You can use Finder’s menu (Go > Goto Folder…) to navigate to that path. You’ll have to enter the path in Finder’s Goto Folder box like this:


Once you click the Go button, Finder will take you straight to the application’s Documents folder.


That’s it. Now you know two ways to access your iOS application’s Documents folder.


4 Responses

  1. There any way to pre-populate documents Directory?, I need to have pre-loaded data in there for initial settings, and then download data in there. Thanks in advance App lADY.

  2. Hi! Nice post. I got a question related to this. I have a json file on my Bundle files and I need to create a path to access my Document Folder (where I have downloaded some resources) do you know anyway to create this path?
    My json when reads from bundle looks like that:
    “jsList” : [
    I was thinking to create something like that:
    “jsList” : [

    But without success.
    Any ideas???

    Thanks a lot!

Leave a Reply

UIDocument Demystified: A Step-by-step Guide on Local and iCloud Document Storage