Written by Sean Behan on Wed Jun 06th 2018

You can add this snippet to your application, say for instance in your viewDidLoad function, that will print to the XCode console, the location of your app while it's being developed.

    // prints the location of asset my-added-file.txt that you've added to the project
print(Bundle.main.path(forResource: "my-added-file", ofType:"txt") as! String)
    // prints the location of the Documents directory your app has access to 
print( FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] )
    // prints the location of the application support directory
print( NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true) )

Tagged with..
#swift #file manager #debugging #console #xcode

Just finishing up brewing up some fresh ground comments...