Swift: Use NSUserDefaults to Store Persistence Data
From Hawk Wiki
Revision as of 04:02, 23 March 2015 by Hall (Talk | contribs) (Created page with "<pre class="brush:swift"> //Set data NSUserDefaults.standardUserDefaults().setObject(["settingABC": false], forKey: "settingABC") //Load Data //func objectForKey(defaultName:...")
//Set data NSUserDefaults.standardUserDefaults().setObject(["settingABC": false], forKey: "settingABC") //Load Data //func objectForKey(defaultName: String) -> AnyObject? let settings = NSUserDefaults.standardUserDefaults().objectForKey("settingABC") as? [String: Bool]