Working with NSUserDefaults in Swift 2

I was quite pleased to see than in Swift is even easier than in Objective-C. Here is how you do it: Create a variable that can access them:        var userDefaults = NSUserDefaults.standardUserDefaults()   Add values to dictionary:       userDefaults.setObject(“StringText”, forKey: “KeyInDictionary”)   Read values from dictionary:            let text = userDefaults.objectForKey(“KeyInDictionary”) as! …