Skip to content

Instantly share code, notes, and snippets.

@fipso
Created September 4, 2021 21:01
Show Gist options
  • Save fipso/3457823a9519db5b14d2ce3d84924272 to your computer and use it in GitHub Desktop.
Save fipso/3457823a9519db5b14d2ce3d84924272 to your computer and use it in GitHub Desktop.
import Foundation
struct Temperatures: Codable {
let data: DataClass
}
struct DataClass: Codable {
let de: De
enum CodingKeys: String, CodingKey {
case de = "DE"
}
}
struct De: Codable {
let isoAlpha2, name, continent: String
let advisory: Advisory
enum CodingKeys: String, CodingKey {
case isoAlpha2 = "iso_alpha2"
case name, continent, advisory
}
}
struct Advisory: Codable {
let score: Double
let sourcesActive: Int
let message, updated: String
let source: String
enum CodingKeys: String, CodingKey {
case score
case sourcesActive = "sources_active"
case message, updated, source
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment