Mercurial > public > geoquiz
diff GeoQuiz/GuessTheCountryView.swift @ 7:d945e52b0704
implement dynamic map
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Tue, 04 Oct 2022 18:54:24 +0200 |
parents | 1946bbfde4af |
children | e09959b4e4a8 |
line wrap: on
line diff
--- a/GeoQuiz/GuessTheCountryView.swift Thu Sep 29 12:00:17 2022 +0200 +++ b/GeoQuiz/GuessTheCountryView.swift Tue Oct 04 18:54:24 2022 +0200 @@ -6,10 +6,8 @@ // import SwiftUI -import MapKit struct GuessTheCountryView: View { - @Binding var gameName: GameName? @StateObject var game = CityGame() var body: some View { @@ -22,15 +20,8 @@ GameToolbar(game: game, color: .pinkLavender) Spacer() - - CityMap(region: MKCoordinateRegion( - center: CLLocationCoordinate2D( - latitude: game.correctAnswer.value.lat, - longitude: game.correctAnswer.value.lon - ), - span: MKCoordinateSpan(latitudeDelta: 0.5, longitudeDelta: 0.5)) - ) - .frame(height: geo.size.height * 0.3) + + CityMap(game: game) Spacer() @@ -68,19 +59,12 @@ } } .navigationBarHidden(true) - .modifier(GameAlertsModifier(game: game, gameName: $gameName)) - .sheet(isPresented: $game.showingBuyLivesView) { - BuyLivesModalView() - } - - .sheet(isPresented: $game.showingGameStatsView) { -// GameStatsModalView(game: game) - } + .modifier(GameAlertsModifier(game: game)) } } struct GuessTheCountryView_Previews: PreviewProvider { static var previews: some View { - GuessTheCountryView(gameName: .constant(GameName.guessTheCountry)) + GuessTheCountryView() } }