Skip to content

Instantly share code, notes, and snippets.

@ArchieR7
Last active September 19, 2017 21:25
Show Gist options
  • Save ArchieR7/fd3552e7a86153a5d5a20e41b2d36fd6 to your computer and use it in GitHub Desktop.
Save ArchieR7/fd3552e7a86153a5d5a20e41b2d36fd6 to your computer and use it in GitHub Desktop.
/*
{
"status": true,
"user": {
"ID": "1234567890",
"name": "Archie",
"email": "[email protected]"
}
*/
guard let status = result["status"] as? Bool,
let ID = (result["user"] as? [String: Any])?["ID"] as? String,
let name = (result["user"] as? [String: Any])?["name"] as? String,
let email = (result["user"] as? [String: Any])?["email"] as? String else {
throw Error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment