view GeoQuiz/Models/CountryModel.swift @ 7:d945e52b0704

implement dynamic map
author Dennis C. M. <dennis@denniscm.com>
date Tue, 04 Oct 2022 18:54:24 +0200
parents 1946bbfde4af
children
line wrap: on
line source

//
//  CountryModel.swift
//  GeoQuiz
//
//  Created by Dennis Concepción Martín on 29/9/22.
//

import Foundation

struct CountryModel: Codable {
    let countries: [String: CountryData]
    
    struct CountryData: Codable, Equatable, Hashable {
        let flag: String
        let currency: String
        let population: Int
        let capital: String
        
        static func ==(lhs: CountryData, rhs: CountryData) -> Bool {
            lhs.flag == rhs.flag &&
            lhs.currency == rhs.currency &&
            lhs.population == rhs.population &&
            lhs.capital == rhs.capital
        }
    }
}