Mercurial > public > geoquiz
diff GeoQuiz/SettingsModalView.swift @ 5:f31a61462e7a
add sound effects
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Sat, 24 Sep 2022 12:02:09 +0100 |
parents | |
children | d945e52b0704 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GeoQuiz/SettingsModalView.swift Sat Sep 24 12:02:09 2022 +0100 @@ -0,0 +1,42 @@ +// +// SettingsModalView.swift +// GeoQuiz +// +// Created by Dennis Concepción Martín on 22/9/22. +// + +import SwiftUI + +struct SettingsModalView: View { + @Environment(\.dismiss) var dismiss + + // CHANGE THIS IN PRODUCTION + @State private var testHapticsIsOn = true + @State private var testGameEffectIsOn = true + // CHANGE THIS IN PRODUCTION + + var body: some View { + NavigationView { + Form { + Toggle("Haptics is on", isOn: $testHapticsIsOn) + Toggle("Game effect is on", isOn: $testGameEffectIsOn) + } + .navigationTitle("Settings") + .toolbar { + ToolbarItem(placement: .cancellationAction) { + Button { + dismiss() + } label: { + Label("Exit", systemImage: "multiply") + } + } + } + } + } +} + +struct SettingsModalView_Previews: PreviewProvider { + static var previews: some View { + SettingsModalView() + } +}