Skip to content

Instantly share code, notes, and snippets.

@rcerrejon
Created April 7, 2017 08:39
Show Gist options
  • Save rcerrejon/da9ec81145479c648b533631dd6a37ea to your computer and use it in GitHub Desktop.
Save rcerrejon/da9ec81145479c648b533631dd6a37ea to your computer and use it in GitHub Desktop.
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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment