-
-
Save Pasanpr/2bdbff6a470d5861b9a1f0643da98e24 to your computer and use it in GitHub Desktop.
Initial code snippet for An Overview of Codable: A Quick Peek
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
import Foundation | |
let json = """ | |
{ | |
"name": "Pasan", | |
"id": 1, | |
"role": "Teacher" | |
} | |
""".data(using: .utf8)! | |
struct Employee { | |
let name: String | |
let id: Int | |
let role: String | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment