A sandboxed MacOS app can easily access data in two folders ...
- ~/Library/Containers/ProgramName/
- ~/Library/Group Containers/SecurityGroupName/
The following code will give me the "~/Library/Group Container/" path ...
let fileManager = FileManager.default
let directory = fileManager.containerURL(forSecurityApplicationGroupIdentifier: "myGroup")
print("path:",directory)
This will print: "path: /Users/myName/Library/Group Containers/myGroup"
I want to get the path of the "~/Library/Containers/" directory, not the "~/Library/Group Containers/" directory.
This must be easy to do, as it is a common directory.
Does anybody know how to do this using a swift function.
I know I can just create it with ...
var path: String = "/Users/etc/Containers/" + programName
Ian