Skip to content

Instantly share code, notes, and snippets.

@Pasanpr Pasanpr/DynamicKeys.swift Secret
Last active Mar 28, 2018

Embed
What would you like to do?
Starter Code for S4:V1 - Dynamic Coding Keys
import Foundation
let json = """
{
"languages": {
"python": {
"designer": [
"Guido van Rossum"
],
"released": "20 February 1991"
},
"java": {
"designer": [
"James Gosling"
],
"released": "May 23, 1995"
},
"swift": {
"designer": [
"Chris Lattner",
"Apple Inc"
],
"released": "June 2, 2014"
},
"ruby": {
"designer": [
"Yukihiro Matsumoto"
],
"released": "1995"
}
}
}
""".data(using: .utf8)!
struct Language {
let name: String
let designer: [String]
let releaseDate: String
}
struct Library {
let languages: [Language]
}
let decoder = JSONDecoder()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.