30
|
1 //
|
|
2 // DatasetView-ViewModel.swift
|
|
3 // GeoQuiz
|
|
4 //
|
|
5 // Created by Dennis Concepción Martín on 10/11/22.
|
|
6 //
|
|
7
|
|
8 import Foundation
|
|
9
|
|
10 extension DatasetView {
|
|
11 class ViewModel {
|
|
12 let countries: Set<String>
|
|
13 let cities: Set<String>
|
|
14
|
|
15 init() {
|
|
16 let countryData: CountryModel = Bundle.main.decode("countries.json")
|
|
17 let cityData: CityModel = Bundle.main.decode("cities.json")
|
|
18
|
|
19 self.countries = Set(countryData.countries.keys)
|
|
20 self.cities = Set(cityData.cities.keys)
|
|
21 }
|
|
22 }
|
|
23 }
|