Last active
November 4, 2017 17:39
-
-
Save pgpt10/40863d7140fcf88462cf5e4504eed141 to your computer and use it in GitHub Desktop.
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
let jsonString = """ | |
{ | |
"type":"fruit", | |
"size":{ | |
"width":150, | |
"height":150 | |
}, | |
"title":"Apple", | |
"url":"https:\\/\\/www.fruits.com\\/apple", | |
"isSample":true, | |
"metaData":{ | |
"color":"green" | |
} | |
} | |
""" | |
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