Created
December 17, 2014 23:02
-
-
Save samratshaw/4ba3c1dd9ccf8784aaa3 to your computer and use it in GitHub Desktop.
Storage Options in Swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Printing all values in User Defaults */ | |
println(NSUserDefaults.standardUserDefaults().dictionaryRepresentation()); | |
/* Printing only keys in the User Defaults */ | |
println(NSUserDefaults.standardUserDefaults().dictionaryRepresentation().keys.array); | |
/* Printing only keys in the User Defaults */ | |
println(NSUserDefaults.standardUserDefaults().dictionaryRepresentation().values.array); | |
/* Storing in User Defaults */ | |
NSUserDefaults.standardUserDefaults().setObject(value, forKey: key); | |
NSUserDefaults.standardUserDefaults().synchronize(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment