6
|
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 }
|