Last active
November 4, 2017 17:58
-
-
Save pgpt10/4f8fc3ed32c052109d97b0530f341a0d 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
let jsonString = """ | |
{ | |
"type":"fruit", | |
"size":{ | |
"width":150, | |
"height":150 | |
}, | |
"name":"Apple", | |
"link":"https:\\/\\/www.fruits.com\\/apple", | |
"isSample":true, | |
"metaData":{ | |
"color":"green" | |
}, | |
"format":"gif" | |
} | |
""" | |
if let jsonData = jsonString.data(using: .utf8) | |
{ | |
let photoObject = try? JSONDecoder().decode(Photo.self, from: jsonData) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment