comparison GeoQuiz/GuessTheFlagView-ViewModel.swift @ 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 3f4b366d476d
children
comparison
equal deleted inserted replaced
30:eb23effeede7 31:9d6dd0e59c22
11 extension GuessTheFlagView { 11 extension GuessTheFlagView {
12 12
13 class Layout { 13 class Layout {
14 14
15 static func showFlag(in flagPath: String, geo: GeometryProxy, _ userController: UserController) -> some View { 15 static func showFlag(in flagPath: String, geo: GeometryProxy, _ userController: UserController) -> some View {
16 switch userController.data.guessTheFlagShape { 16 switch userController.data.guessTheFlagAspectRatio {
17 case .respectAspectRatio: 17 case .original:
18 return AnyView( 18 return AnyView(
19 RoundedRectangle(cornerRadius: 20) 19 RoundedRectangle(cornerRadius: 20)
20 .foregroundColor(.white.opacity(0.5)) 20 .foregroundColor(.white.opacity(0.5))
21 .frame(width: geo.size.height * 0.3, height: geo.size.height * 0.15) 21 .frame(width: geo.size.height * 0.3, height: geo.size.height * 0.15)
22 .overlay( 22 .overlay(
42 return AnyView( 42 return AnyView(
43 Image(uiImage: UIImage(contentsOfFile: flagPath)!) 43 Image(uiImage: UIImage(contentsOfFile: flagPath)!)
44 .renderingMode(.original) 44 .renderingMode(.original)
45 .resizable() 45 .resizable()
46 .scaledToFill() 46 .scaledToFill()
47 .frame(width: geo.size.height * 0.3, height: geo.size.height * 0.15) 47 .frame(width: geo.size.height * 0.25, height: geo.size.height * 0.14)
48 .clipShape(RoundedRectangle(cornerRadius: 20)) 48 .clipShape(RoundedRectangle(cornerRadius: 20))
49 .shadow(radius: 10) 49 .shadow(radius: 10)
50 ) 50 )
51 } 51 }
52 } 52 }