Skip to content

Instantly share code, notes, and snippets.

@dejanskledar
Created October 16, 2017 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dejanskledar/fe27e0f5ae526cc36116df00c2588e92 to your computer and use it in GitHub Desktop.
Save dejanskledar/fe27e0f5ae526cc36116df00c2588e92 to your computer and use it in GitHub Desktop.
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