Mercurial > public > geoquiz
changeset 31:9d6dd0e59c22
remove dataset and add new screenshots
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Fri, 11 Nov 2022 08:59:02 +0100 |
parents | eb23effeede7 |
children | c62d6f92709d |
files | GeoQuiz/GuessTheCountryView.swift GeoQuiz/GuessTheFlagView-ViewModel.swift GeoQuiz/Models/UserDataModel.swift GeoQuiz/Resources/cities.json GeoQuiz/SettingsModalView-ViewModel.swift GeoQuiz/SettingsModalView.swift screenshots/iPad Pro/raw/2.png screenshots/iPad Pro/raw/4.png screenshots/iPhone 11/raw/2.png screenshots/iPhone 11/raw/4.png screenshots/iPhone 8/raw/2.png screenshots/iPhone 8/raw/4.png |
diffstat | 12 files changed, 27 insertions(+), 166 deletions(-) [+] |
line wrap: on
line diff
--- a/GeoQuiz/GuessTheCountryView.swift Thu Nov 10 11:51:52 2022 +0100 +++ b/GeoQuiz/GuessTheCountryView.swift Fri Nov 11 08:59:02 2022 +0100 @@ -25,7 +25,7 @@ Spacer() CityMap(game: gameController) - .frame(height: geo.size.height * 0.35) + .frame(height: geo.size.height * 0.30) .padding(.bottom) Spacer()
--- a/GeoQuiz/GuessTheFlagView-ViewModel.swift Thu Nov 10 11:51:52 2022 +0100 +++ b/GeoQuiz/GuessTheFlagView-ViewModel.swift Fri Nov 11 08:59:02 2022 +0100 @@ -13,8 +13,8 @@ class Layout { static func showFlag(in flagPath: String, geo: GeometryProxy, _ userController: UserController) -> some View { - switch userController.data.guessTheFlagShape { - case .respectAspectRatio: + switch userController.data.guessTheFlagAspectRatio { + case .original: return AnyView( RoundedRectangle(cornerRadius: 20) .foregroundColor(.white.opacity(0.5)) @@ -44,7 +44,7 @@ .renderingMode(.original) .resizable() .scaledToFill() - .frame(width: geo.size.height * 0.3, height: geo.size.height * 0.15) + .frame(width: geo.size.height * 0.25, height: geo.size.height * 0.14) .clipShape(RoundedRectangle(cornerRadius: 20)) .shadow(radius: 10) )
--- a/GeoQuiz/Models/UserDataModel.swift Thu Nov 10 11:51:52 2022 +0100 +++ b/GeoQuiz/Models/UserDataModel.swift Fri Nov 11 08:59:02 2022 +0100 @@ -14,7 +14,7 @@ var haptics: Bool = true var sound: Bool = true var numberOfLives: Int = 25 - var guessTheFlagShape: GuessTheFlagShape = .respectAspectRatio + var guessTheFlagAspectRatio: GuessTheFlagAspectRatio = .original // Profile var username: String = "Unnamed" @@ -26,8 +26,8 @@ } } -enum GuessTheFlagShape: String, Codable, CaseIterable { - case respectAspectRatio = "Original" +enum GuessTheFlagAspectRatio: String, Codable, CaseIterable { + case original = "Original" case circular = "Circular" case rectangular = "Rectangular"
--- a/GeoQuiz/Resources/cities.json Thu Nov 10 11:51:52 2022 +0100 +++ b/GeoQuiz/Resources/cities.json Fri Nov 11 08:59:02 2022 +0100 @@ -121940,71 +121940,11 @@ "lat": 42.5091391, "lon": 41.866992 }, - "Bruce's Farm": { - "country": "Gibraltar", - "lat": 36.1405329, - "lon": -5.3478735 - }, "Buena Vista": { "country": "United States", "lat": 38.8422178, "lon": -106.1311288 }, - "Caleta": { - "country": "Gibraltar", - "lat": 18.450247, - "lon": -69.67309929999999 - }, - "Catalan Bay": { - "country": "Gibraltar", - "lat": 36.1389991, - "lon": -5.340914499999999 - }, - "Catalan Bay Village": { - "country": "Gibraltar", - "lat": 36.1389991, - "lon": -5.340914499999999 - }, - "Cebelitar\u0131k": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "Chibraltar": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "Djibraltar": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "Gibraltar": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "Gibbilterra": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "Gibraltaras": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "LXGB (GIBRALTAR)": { - "country": "Gibraltar", - "lat": 36.1537017, - "lon": -5.3468624 - }, - "Monkeys Alameda": { - "country": "Gibraltar", - "lat": 37.7798721, - "lon": -122.2821855 - }, "Rosia": { "country": "Romania", "lat": 46.3082582, @@ -122015,81 +121955,6 @@ "lat": 33.1495731, "lon": -117.2155415 }, - "Xibraltar": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "Xibraltar - Gibraltar": { - "country": "Gibraltar", - "lat": 36.1407734, - "lon": -5.353599399999999 - }, - "\u011cibraltaro": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "\u0393\u03b9\u03b2\u03c1\u03b1\u03bb\u03c4\u03ac\u03c1": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "\u0413\u0438\u0431\u0440\u0430\u043b\u0442\u0430\u0440": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "\u05d2\u05d9\u05d1\u05e8\u05dc\u05d8\u05e8": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "\u062c\u0628\u0644 \u0637\u0627\u0631\u0642": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "\u062c\u0628\u0644\u200c\u0627\u0644\u0637\u0627\u0631\u0642": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "\u062c\u064a\u0628\u0631\u0627\u0644\u062a\u0627\u0631": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "\u0645\u062d\u0645\u064a\u0629 \u062c\u0628\u0644 \u0637\u0627\u0631\u0642": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "\u091c\u093f\u092c\u094d\u0930\u093e\u0932\u094d\u091f\u0930": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "\u0c9c\u0cbf\u0cac\u0ccd\u0cb0\u0cbe\u0cb2\u0ccd\u0c9f\u0cb0\u0ccd": { - "country": "Gibraltar", - "lat": 49.2192374, - "lon": -2.0285366 - }, - "\u1305\u1265\u122b\u120d\u1273\u122d": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "\u30b8\u30d6\u30e9\u30eb\u30bf\u30eb": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, - "\u76f4\u5e03\u7f57\u9640": { - "country": "Gibraltar", - "lat": 36.140751, - "lon": -5.353585 - }, "Aach": { "country": "Germany", "lat": 47.8405032,
--- a/GeoQuiz/SettingsModalView-ViewModel.swift Thu Nov 10 11:51:52 2022 +0100 +++ b/GeoQuiz/SettingsModalView-ViewModel.swift Fri Nov 11 08:59:02 2022 +0100 @@ -8,7 +8,18 @@ import Foundation extension SettingsModalView { - func getVersion() -> String? { - return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String + class ViewModel { + var lives: [Int] { + var lives = [Int]() + for i in stride(from: 5, to: 55, by: 5) { + lives.append(i) + } + + return lives + } + + func getVersion() -> String? { + return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String + } } }
--- a/GeoQuiz/SettingsModalView.swift Thu Nov 10 11:51:52 2022 +0100 +++ b/GeoQuiz/SettingsModalView.swift Fri Nov 11 08:59:02 2022 +0100 @@ -12,21 +12,14 @@ @Environment(\.dismiss) var dismiss - var lives: [Int] { - var lives = [Int]() - for i in stride(from: 5, to: 55, by: 5) { - lives.append(i) - } - - return lives - } + let viewModel = ViewModel() var body: some View { NavigationStack { Form { Section { Picker("❤️ Lives", selection: $userController.data.numberOfLives) { - ForEach(lives, id: \.self) { numberOfLives in + ForEach(viewModel.lives, id: \.self) { numberOfLives in Text("\(numberOfLives)") .tag(numberOfLives) } @@ -43,10 +36,10 @@ } Section { - Picker("Flag shape", selection: $userController.data.guessTheFlagShape) { - ForEach(GuessTheFlagShape.allCases, id: \.self) { shape in - Text(shape.localizedName) - .tag(shape) + Picker("Flag aspect ratio", selection: $userController.data.guessTheFlagAspectRatio) { + ForEach(GuessTheFlagAspectRatio.allCases, id: \.self) { aspectRatio in + Text(aspectRatio.localizedName) + .tag(aspectRatio) } } } header: { @@ -62,14 +55,6 @@ ) } - NavigationLink(destination: DatasetView()) { - SettingsRow( - color: .atomicTangerine, - symbol: "square.stack.3d.up.fill", - text: "Dataset" - ) - } - Link(destination: URL(string: "mailto:dmartin@dennistech.io")!) { SettingsRow( color: .chinaPink, @@ -92,7 +77,7 @@ Text("© 2022 Dennis Technologies Ltd.") Text("Proud to be indie.") - if let versionNumber = getVersion() { + if let versionNumber = viewModel.getVersion() { Text("Version \(versionNumber)") } }