rcerrejon
4/7/2017 - 8:39 AM

UserSettings in Swift 3

UserSettings in Swift 3

// inside the Class outside function
let userSettings = UserDefaults.standard

// Setter
userSettings.set("foo", forKey: "foobar")

// Getter
let foo = userSettings.string(forKey: "foobar")