Skip to content

Instantly share code, notes, and snippets.

@alekseypotapov-dev
Last active April 18, 2021 10:02
Show Gist options
  • Save alekseypotapov-dev/a64043afab82d07a9295 to your computer and use it in GitHub Desktop.
Save alekseypotapov-dev/a64043afab82d07a9295 to your computer and use it in GitHub Desktop.
Find the ios simulator's application folder documents on Mac
NSLog(@"Documents Directory: %@",
[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory
inDomains:NSUserDomainMask] lastObject]);
@opotapov-sygic
Copy link

opotapov-sygic commented Aug 10, 2017

For Swift consider the following:

let documentDirectoryURL =  try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
let cacheDirectoryURL = try! FileManager.default.url(for: .cachesDirectory, in: .userDomainMask, appropriateFor: nil, create: true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment