Last active
December 14, 2017 12:01
-
-
Save JillevdW/90b60c880bd8ae3998c3c7619e28af80 to your computer and use it in GitHub Desktop.
Codable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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