To read and save data from my App I want to use documents folder of the user. When debugging, this is mapped to somewhere else. But I want to have the "real" user document folder. I want to avoid to use a fixed path name to my user when debugging. Actually I'm using
if let dirs : [String] = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.AllDomainsMask, true) as? [String] {
let dir = dirs[0] // documents directory
return dir.stringByAppendingPathComponent(filenameOnly)
}
where filenameOnly is the file I like to access.