Created
October 16, 2017 14:07
-
-
Save dejanskledar/fe27e0f5ae526cc36116df00c2588e92 to your computer and use it in GitHub Desktop.
This file contains 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
let json = """ | |
{ | |
"length": 120, | |
"is_valyrian_steel": true, | |
"sword_name": "Oathkeeper" | |
} | |
""" | |
let data = json.data(using: .utf8) | |
let sword = try? JSONDecoder().decode(Sword.self, from: data!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment