comparison GeoQuiz/SettingsModalView.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 eb23effeede7
comparison
equal deleted inserted replaced
26:425078c01194 27:3f4b366d476d
30 Text("\(numberOfLives)") 30 Text("\(numberOfLives)")
31 .tag(numberOfLives) 31 .tag(numberOfLives)
32 } 32 }
33 } 33 }
34 } header: { 34 } header: {
35 Text("Game") 35 Text("General")
36 } footer: { 36 } footer: {
37 Text("Number of lives at the beginning of each game.") 37 Text("Number of lives at the beginning of each game.")
38 }
39
40 Section {
41 Picker("Flag shape", selection: $userController.data.guessTheFlagShape) {
42 ForEach(GuessTheFlagShape.allCases, id: \.self) { shape in
43 Text(shape.localizedName)
44 .tag(shape)
45 }
46 }
47 } header: {
48 Text("Guess the flag game")
38 } 49 }
39 50
40 Section { 51 Section {
41 Toggle("Haptics", isOn: $userController.data.haptics) 52 Toggle("Haptics", isOn: $userController.data.haptics)
42 Toggle("Sound effects", isOn: $userController.data.sound) 53 Toggle("Sound effects", isOn: $userController.data.sound)
43 } header: { 54 } header: {
44 Text("Effects") 55 Text("Effects")
45 } 56 }
46 57
47 Section { 58 Section {
48 FormLink( 59 SettingsRow(
49 color: .mayaBlue, 60 color: .mayaBlue,
50 symbol: "info.circle.fill", 61 symbol: "person.fill",
51 text: "About", 62 text: "About",
52 url: URL(string: "https://dennistech.io")! 63 url: URL(string: "https://dennistech.io")!
53 ) 64 )
54 65
55 FormLink( 66 SettingsRow(
56 color: .atomicTangerine, 67 color: .atomicTangerine,
57 symbol: "ant.circle.fill", 68 symbol: "ant.fill",
58 text: "Report bugs", 69 text: "Report bugs",
59 url: URL(string: "mailto:dmartin@dennistech.io")! 70 url: URL(string: "mailto:dmartin@dennistech.io")!
60 ) 71 )
61 72
62 FormLink( 73 SettingsRow(
63 color: .blueBell, 74 color: .blueBell,
64 symbol: "message.circle.fill", 75 symbol: "message.fill",
65 text: "Twitter", 76 text: "Twitter",
66 url: URL(string: "https://twitter.com/dennistech_")! 77 url: URL(string: "https://twitter.com/dennistech_")!
67 ) 78 )
68 } header: { 79 } header: {
69 Text("Get in touch") 80 Text("Get in touch")
81 } footer: {
82 HStack {
83 Spacer()
84 VStack {
85 Text("© 2022 Dennis Technologies Ltd.")
86 Text("Proud to be indie.")
87
88 if let versionNumber = getVersion() {
89 Text("Version \(versionNumber)")
90 }
91 }
92 Spacer()
93 }
94 .padding(.top)
70 } 95 }
71 } 96 }
72 .navigationTitle("Settings") 97 .navigationTitle("Settings")
73 .navigationBarTitleDisplayMode(.inline) 98 .navigationBarTitleDisplayMode(.inline)
74 .toolbar { 99 .toolbar {