comparison GeoQuiz/ViewModels/ContentView-ViewModel.swift @ 26:425078c01194

refactor code
author Dennis C. M. <dennis@denniscm.com>
date Wed, 09 Nov 2022 10:30:01 +0100
parents
children
comparison
equal deleted inserted replaced
25:b3df0f5dc750 26:425078c01194
1 //
2 // ContentView-ViewModel.swift
3 // GeoQuiz
4 //
5 // Created by Dennis Concepción Martín on 7/11/22.
6 //
7
8 import Foundation
9
10 extension ContentView {
11 @MainActor class ViewModel: ObservableObject {
12 @Published var path: [GameType] = []
13 @Published var showingBuyPremiumModalView = false
14 @Published var showingSettingsModalView = false
15 @Published var showingProfileModalView = false
16
17 let premiumGames: [GameType] = [.guessTheCapital, .guessTheCountry, .guessThePopulation]
18
19 func go(to gameType: GameType) {
20 path.append(gameType)
21 }
22 }
23 }