diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GeoQuiz/ViewModels/ContentView-ViewModel.swift	Wed Nov 09 10:30:01 2022 +0100
@@ -0,0 +1,23 @@
+//
+//  ContentView-ViewModel.swift
+//  GeoQuiz
+//
+//  Created by Dennis Concepción Martín on 7/11/22.
+//
+
+import Foundation
+
+extension ContentView {
+    @MainActor class ViewModel: ObservableObject {
+        @Published var path: [GameType] = []
+        @Published var showingBuyPremiumModalView = false
+        @Published var showingSettingsModalView = false
+        @Published var showingProfileModalView = false
+        
+        let premiumGames: [GameType] = [.guessTheCapital, .guessTheCountry, .guessThePopulation]
+        
+        func go(to gameType: GameType) {
+            path.append(gameType)
+        }
+    }
+}