comparison GeoQuiz/Logic/CountryModel.swift @ 10:a793f33f05fb

refactor code and fix layout
author Dennis C. M. <dennis@denniscm.com>
date Sat, 08 Oct 2022 21:36:40 +0200
parents GeoQuiz/Models/CountryModel.swift@1946bbfde4af
children f140bb277c96
comparison
equal deleted inserted replaced
9:3540c7efc216 10:a793f33f05fb
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 CountryData: Codable {
11 let countries: [String: Country]
12
13 struct Country: Codable, Equatable, Hashable {
14 let flag: String
15 let currency: String
16 let population: Int
17 let capital: String
18
19 static func ==(lhs: Country, rhs: Country) -> Bool {
20 lhs.flag == rhs.flag &&
21 lhs.currency == rhs.currency &&
22 lhs.population == rhs.population &&
23 lhs.capital == rhs.capital
24 }
25 }
26 }