Mercurial > public > geoquiz
diff GeoQuiz/Models/CityModel.swift @ 6:1946bbfde4af
reformat data structures
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Thu, 29 Sep 2022 12:00:17 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GeoQuiz/Models/CityModel.swift Thu Sep 29 12:00:17 2022 +0200 @@ -0,0 +1,22 @@ +// +// CityModel.swift +// GeoQuiz +// +// Created by Dennis Concepción Martín on 29/9/22. +// + +import Foundation + +struct CityModel: Codable { + let cities: [String: CityData] + + struct CityData: Codable, Equatable { + let country: String + let lat: Double + let lon: Double + + static func ==(lhs: CityData, rhs: CityData) -> Bool { + lhs.country == rhs.country + } + } +}