Skip to content

Instantly share code, notes, and snippets.

@JillevdW
Last active December 14, 2017 12:01
Show Gist options
  • Save JillevdW/90b60c880bd8ae3998c3c7619e28af80 to your computer and use it in GitHub Desktop.
Save JillevdW/90b60c880bd8ae3998c3c7619e28af80 to your computer and use it in GitHub Desktop.
Codable
struct Person : Codable {
var name: String
var address: String
var avatarUrl: String
}
let person = try! JSONDecoder().decode(Person.self, from: onePersonJsonString!)
let people = try! JSONDecoder().decode([Person].self, from: multiplePeopleJsonString!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment