implement settings
This commit is contained in:
41
MultiChrono/SettingsView.swift
Normal file
41
MultiChrono/SettingsView.swift
Normal file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// SettingsView.swift
|
||||
// MultiChrono
|
||||
//
|
||||
// Created by Beatrice Dellacà on 27/01/26.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct SettingsView: View {
|
||||
@ObservedObject var settings = AppSettings.shared
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
Form {
|
||||
Section(header: Text("Time Display Format")) {
|
||||
Picker("Format", selection: $settings.timeFormat) {
|
||||
ForEach(TimeFormat.allCases, id: \.self) { format in
|
||||
Text(format.displayName).tag(format)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
}
|
||||
}
|
||||
.navigationTitle("Settings")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button("Done") {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
SettingsView()
|
||||
}
|
||||
Reference in New Issue
Block a user