Mercurial > public > geoquiz
changeset 23:02dcebb8cc4a
fix layout issues
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Thu, 27 Oct 2022 09:17:13 +0200 |
parents | 56add5561261 |
children | 2e9600b03fe5 |
files | GeoQuiz/Assets.xcassets/Custom colors/AtomicTangerine.colorset/Contents.json GeoQuiz/Assets.xcassets/Custom colors/PinkLavender.colorset/Contents.json GeoQuiz/GuessTheCapitalView.swift GeoQuiz/GuessTheCountryView.swift GeoQuiz/GuessTheFlagView.swift GeoQuiz/GuessThePopulationView.swift GeoQuiz/Logic/PersistenceController.swift GeoQuiz/ProfileModalView.swift |
diffstat | 8 files changed, 35 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/GeoQuiz/Assets.xcassets/Custom colors/AtomicTangerine.colorset/Contents.json Wed Oct 26 08:20:19 2022 +0200 +++ b/GeoQuiz/Assets.xcassets/Custom colors/AtomicTangerine.colorset/Contents.json Thu Oct 27 09:17:13 2022 +0200 @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "84", - "green" : "142", - "red" : "247" + "blue" : "0x54", + "green" : "0x8E", + "red" : "0xF7" } }, "idiom" : "universal"
--- a/GeoQuiz/Assets.xcassets/Custom colors/PinkLavender.colorset/Contents.json Wed Oct 26 08:20:19 2022 +0200 +++ b/GeoQuiz/Assets.xcassets/Custom colors/PinkLavender.colorset/Contents.json Thu Oct 27 09:17:13 2022 +0200 @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "231", - "green" : "195", - "red" : "238" + "blue" : "0xE7", + "green" : "0xC3", + "red" : "0xEE" } }, "idiom" : "universal"
--- a/GeoQuiz/GuessTheCapitalView.swift Wed Oct 26 08:20:19 2022 +0200 +++ b/GeoQuiz/GuessTheCapitalView.swift Thu Oct 27 09:17:13 2022 +0200 @@ -20,6 +20,7 @@ GeometryReader { geo in VStack { GameToolbar(game: game, color: .atomicTangerine) + .padding(.bottom) Spacer() @@ -79,6 +80,10 @@ GuessTheCapitalView() .previewDevice(PreviewDevice(rawValue: "iPad Pro (12.9-inch) (5th generation)")) - .previewDisplayName("iPad Pro (12.9-inch) (5th generation)") + .previewDisplayName("iPad Pro (12.9-inch)") + + GuessTheCapitalView() + .previewDevice(PreviewDevice(rawValue: "iPhone 8")) + .previewDisplayName("iPhone 8") } }
--- a/GeoQuiz/GuessTheCountryView.swift Wed Oct 26 08:20:19 2022 +0200 +++ b/GeoQuiz/GuessTheCountryView.swift Thu Oct 27 09:17:13 2022 +0200 @@ -20,11 +20,13 @@ GeometryReader { geo in VStack { GameToolbar(game: game, color: .pinkLavender) + .padding(.bottom) Spacer() CityMap(game: game) .frame(height: geo.size.height * 0.35) + .padding(.bottom) Spacer() @@ -74,6 +76,10 @@ GuessTheCountryView() .previewDevice(PreviewDevice(rawValue: "iPad Pro (12.9-inch) (5th generation)")) - .previewDisplayName("iPad Pro (12.9-inch) (5th generation)") + .previewDisplayName("iPad Pro (12.9-inch)") + + GuessTheCountryView() + .previewDevice(PreviewDevice(rawValue: "iPhone 8")) + .previewDisplayName("iPhone 8") } }
--- a/GeoQuiz/GuessTheFlagView.swift Wed Oct 26 08:20:19 2022 +0200 +++ b/GeoQuiz/GuessTheFlagView.swift Thu Oct 27 09:17:13 2022 +0200 @@ -79,6 +79,10 @@ GuessTheFlagView() .previewDevice(PreviewDevice(rawValue: "iPad Pro (12.9-inch) (5th generation)")) - .previewDisplayName("iPad Pro (12.9-inch) (5th generation)") + .previewDisplayName("iPad Pro (12.9-inch)") + + GuessTheFlagView() + .previewDevice(PreviewDevice(rawValue: "iPhone 8")) + .previewDisplayName("iPhone 8") } }
--- a/GeoQuiz/GuessThePopulationView.swift Wed Oct 26 08:20:19 2022 +0200 +++ b/GeoQuiz/GuessThePopulationView.swift Thu Oct 27 09:17:13 2022 +0200 @@ -20,6 +20,7 @@ GeometryReader { geo in VStack { GameToolbar(game: game, color: .maizeCrayola) + .padding(.bottom) Spacer() @@ -80,6 +81,10 @@ GuessThePopulationView() .previewDevice(PreviewDevice(rawValue: "iPad Pro (12.9-inch) (5th generation)")) - .previewDisplayName("iPad Pro (12.9-inch) (5th generation)") + .previewDisplayName("iPad Pro (12.9-inch)") + + GuessThePopulationView() + .previewDevice(PreviewDevice(rawValue: "iPhone 8")) + .previewDisplayName("iPhone 8") } }
--- a/GeoQuiz/Logic/PersistenceController.swift Wed Oct 26 08:20:19 2022 +0200 +++ b/GeoQuiz/Logic/PersistenceController.swift Thu Oct 27 09:17:13 2022 +0200 @@ -18,7 +18,7 @@ let viewContext = result.container.viewContext #if DEBUG - createMockData(nil, viewContext) + createMockData(with: viewContext) #endif return result @@ -41,7 +41,7 @@ } #if DEBUG - static func createMockData(_ playedGames: FetchedResults<PlayedGame>?, _ moc: NSManagedObjectContext) { + static func createMockData(with moc: NSManagedObjectContext) { for _ in 0..<10 { let playedGame = PlayedGame(context: moc)
--- a/GeoQuiz/ProfileModalView.swift Wed Oct 26 08:20:19 2022 +0200 +++ b/GeoQuiz/ProfileModalView.swift Thu Oct 27 09:17:13 2022 +0200 @@ -80,7 +80,9 @@ #if DEBUG .onAppear { - PersistenceController.createMockData(playedGames, moc) + if playedGames.isEmpty { + PersistenceController.createMockData(with: moc) + } } #endif }