diff GeoQuiz/GuessTheCountryView.swift @ 19:f140bb277c96

refactor code
author Dennis C. M. <dennis@denniscm.com>
date Sun, 23 Oct 2022 00:11:38 +0100
parents f1967f8cc67b
children 02dcebb8cc4a
line wrap: on
line diff
--- a/GeoQuiz/GuessTheCountryView.swift	Sat Oct 22 08:56:54 2022 +0100
+++ b/GeoQuiz/GuessTheCountryView.swift	Sun Oct 23 00:11:38 2022 +0100
@@ -8,7 +8,7 @@
 import SwiftUI
 
 struct GuessTheCountryView: View {
-    @StateObject var game = CityGame()
+    @StateObject var game = CityGameController()
     
     @Environment(\.managedObjectContext) var moc
     
@@ -48,7 +48,7 @@
                                     }
                                 } label: {
                                     AnswerButton(
-                                        optionName: game.data[cityName]!.country,
+                                        name: game.data[cityName]!.country,
                                         color: .blueBell
                                     )
                                     .frame(height: geo.size.height * 0.08)