SQLTerminal.app
now available

XPath.app
now available
Want fresh tech tips in your inbox?

How to Find the Directory Locations Your XCode App Uses

       

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 w/ #swift #file manager #debugging #console #xcode

Apps I've Built

XPath Expression Editor
Practice and improve your XPath skills with XPath Editor
Click to buy on the App Store
Photo Location Changer
Easily change the location on your photos and videos
Click here for more info about the app
Photo Date Changer
Easily change the dates and times on your photos and videos
Click here for more info about the app
VocabReminder
English dictionary with notifications so you won't forget what you're studying!
Click here for more info about the app
VocabQuiz
The app that quizzes and scores you on your vocabulary!
Click here for more info about the app