Mercurial > public > geoquiz
comparison GeoQuiz/Models/CountryModel.swift @ 6:1946bbfde4af
reformat data structures
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Thu, 29 Sep 2022 12:00:17 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
5:f31a61462e7a | 6:1946bbfde4af |
---|---|
1 // | |
2 // CountryModel.swift | |
3 // GeoQuiz | |
4 // | |
5 // Created by Dennis Concepción Martín on 29/9/22. | |
6 // | |
7 | |
8 import Foundation | |
9 | |
10 struct CountryModel: Codable { | |
11 let countries: [String: CountryData] | |
12 | |
13 struct CountryData: Codable, Equatable, Hashable { | |
14 let flag: String | |
15 let currency: String | |
16 let population: Int | |
17 let capital: String | |
18 | |
19 static func ==(lhs: CountryData, rhs: CountryData) -> Bool { | |
20 lhs.flag == rhs.flag && | |
21 lhs.currency == rhs.currency && | |
22 lhs.population == rhs.population && | |
23 lhs.capital == rhs.capital | |
24 } | |
25 } | |
26 } |