Last active
July 27, 2020 17:15
-
-
Save giovani-pereira-ifood/ea29f4739cbcd1da0de8bffddfbc1497 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// { | |
// "name": "Kermaine", | |
// "color": "RED", | |
// "number": 14 | |
// } | |
let data = requestData() | |
let decoder = JSONDecoder() | |
let object = try? decoder.decode(User.self, from: data) | |
print(object) // User(name: "Kermaine", color: .red) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment