diff GeoQuiz/GuessTheCapitalView.swift @ 19:f140bb277c96

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