//
//  YHDatePickView.swift
//  galaxy
//
//  Created by EDY on 2024/1/30.
//  Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//

import Foundation

struct YHCountryModel {
    var provincesArray: [YHProvincesModel] = []
    init(dic: [String:[String]]) {
        for (key,value) in dic {
            let model = YHProvincesModel(name: key, dic: value)
            provincesArray.append(model)
            provincesArray.sort { a, b in
                a.provincesName < b.provincesName
            }
        }
    }
}

struct YHProvincesModel {
    var provincesName: String = ""
    var cityArray: [YHCityModel] = []
    init(name : String ,dic:[String]) {
        provincesName = name
        for value in dic {
            let model = YHCityModel(name: value)
            cityArray.append(model)
        }
    }
}

struct YHCityModel {
    var cityName: String = ""
    init(name: String) {
        cityName = name
    }
}
