Skip to content

Instantly share code, notes, and snippets.

@feighter09
Last active October 24, 2016 05:55
Show Gist options
  • Save feighter09/0dbaca6333d7e142e0920e6d0cb5bb45 to your computer and use it in GitHub Desktop.
Save feighter09/0dbaca6333d7e142e0920e6d0cb5bb45 to your computer and use it in GitHub Desktop.
struct Person {
var firstName: String
var lastName: String
var age: String
}
let person = Person(firstName: "Austin", lastName: "Feight", age: -3)
UserDefaults.standard.set(person)
let fetchedPerson = UserDefaults.standard.fetch(Person.self)
assert(fetchedPerson == person)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment