view GeoQuiz/Logic/CountryModel.swift @ 16:1011e56b7832

implement user profile
author Dennis C. M. <dennis@denniscm.com>
date Thu, 20 Oct 2022 13:49:42 +0200
parents a793f33f05fb
children f140bb277c96
line wrap: on
line source

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