UserDefaults documents code example
Example 1: how to fmake sure that data is save in userdefault
let name = "John Doe"
UserDefaults.standard.set(name, forKey: "name")
Example 2: userdefault where
var path: [AnyObject] = NSSearchPathForDirectoriesInDomains(.libraryDirectory, .userDomainMask, true) as [AnyObject]
let folder: String = path[0] as! String
NSLog("Your NSUserDefaults are stored in this folder: %@/Preferences", folder)