Last active
July 27, 2020 17:05
-
-
Save giovani-pereira-ifood/76ce091ea83a0dab0a3dde28b4c30c7d 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
// This data contains the following JSON data | |
// { | |
// "name": "Mario", | |
// "color": "YELLOW" | |
// } | |
let data = requestData() | |
let decoder = JSONDecoder() | |
let object = try? decoder.decode(User.self, from: data) | |
print(object) // User(name: "Mario", color: .yellow) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment