User Documents points to wrong place ?

(Xcode 10 / Swift 4.2) Using ...

let docs = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)

let docsDir = docs[0]

Resolves ... file:///Users/"User"/Library/Containers/"App Name"/Data/Documents/

Shouldn't it be file:///Users/"User"/Documents ?

Accepted Reply

That's the sandbox location. You can't directly access such places unless you turn off the sandbox or ask the user to choose a location.

Replies

That's the sandbox location. You can't directly access such places unless you turn off the sandbox or ask the user to choose a location.

What will be affected if I turn off Sandbox ?

Sandbox is requires to submit in the Mac App Store. If you don't need to distribute via the Mac App Store, you would have to be insane to turn on the sandbox.