diff GeoQuiz/GuessTheCapitalView.swift @ 27:3f4b366d476d

add flag layout settings
author Dennis C. M. <dennis@denniscm.com>
date Thu, 10 Nov 2022 09:26:48 +0100
parents 425078c01194
children 6d574bd1644f
line wrap: on
line diff
--- a/GeoQuiz/GuessTheCapitalView.swift	Wed Nov 09 10:30:01 2022 +0100
+++ b/GeoQuiz/GuessTheCapitalView.swift	Thu Nov 10 09:26:48 2022 +0100
@@ -7,7 +7,7 @@
 
 import SwiftUI
 
-struct GuessTheCapitalView: View {
+struct GuessTheCapitalView: View, GameView {
     @StateObject var gameController = CountryGameController()
     
     @Environment(\.managedObjectContext) var moc
@@ -35,8 +35,8 @@
                      Using `UIImage(contentsOfFile: path)` images aren't cached.
                      */
                     
-                    let flag = gameController.correctAnswer.value.flag
-                    let flagPath = Bundle.main.path(forResource: flag, ofType: "png")!
+                    let flagPath = getFlagPath(forName: gameController.correctAnswer.value.flag)
+                    
                     Image(uiImage: UIImage(contentsOfFile: flagPath)!)
                         .renderingMode(.original)
                         .resizable()