Skip to content

Instantly share code, notes, and snippets.

@rintoandrews90
Created July 27, 2019 17:35
Show Gist options
  • Save rintoandrews90/390e59ff1d9b5cbefb08b0760b9e4dc2 to your computer and use it in GitHub Desktop.
Save rintoandrews90/390e59ff1d9b5cbefb08b0760b9e4dc2 to your computer and use it in GitHub Desktop.
let decoder = JSONDecoder()
let model = try? decoder.decode(User.self, from:jsonData)
struct Name: Codable {
var firstname: String
var lastname: String
}
struct User: Codable {
var userId: String
var jobTitleName: String
var name: Name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment