diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GeoQuiz/Logic/CountryModel.swift	Sat Oct 08 21:36:40 2022 +0200
@@ -0,0 +1,26 @@
+//
+//  CountryModel.swift
+//  GeoQuiz
+//
+//  Created by Dennis Concepción Martín on 29/9/22.
+//
+
+import Foundation
+
+struct CountryData: Codable {
+    let countries: [String: Country]
+    
+    struct Country: Codable, Equatable, Hashable {
+        let flag: String
+        let currency: String
+        let population: Int
+        let capital: String
+        
+        static func ==(lhs: Country, rhs: Country) -> Bool {
+            lhs.flag == rhs.flag &&
+            lhs.currency == rhs.currency &&
+            lhs.population == rhs.population &&
+            lhs.capital == rhs.capital
+        }
+    }
+}