Skip to content

Instantly share code, notes, and snippets.

@jstart
Created August 10, 2016 02:29
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 jstart/0f678c091980827ae2a785186520532f to your computer and use it in GitHub Desktop.
Save jstart/0f678c091980827ae2a785186520532f to your computer and use it in GitHub Desktop.
struct UserResponse {
var _id : String
var first_name : String
var last_name : String
init(JSON: [String : AnyObject]) {
_id = JSON["_id"] as! String
first_name = JSON["first_name"] as! String
last_name = JSON["last_name"] as! String
}
}
/* Inside our completion handler */
var user = UserResponse(JSON: response.result.value as! [String : AnyObject])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment