Delete key values for NSUserDefaults in Swift
removeObjectForKey is the right way to go. This will remove the value for the selected key. The following code sets a string value for a key in NSUserDefaults, prints it and then uses removeObjectForKey to remove and print the key value again. After removeObjectForKey the value is nil. let prefs = NSUserDefaults.standardUserDefaults() var keyValue = … Read more