-
Notifications
You must be signed in to change notification settings - Fork 0
/
SettingsView.swift
50 lines (46 loc) · 1.49 KB
/
SettingsView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// SettingsView.swift
// Komusou
//
// Created by gurrium on 2022/03/08.
//
import SwiftUI
// TODO: kTireSizeKeyの定義はここが適切?
let kTireSizeKey = "tireSize"
struct SettingsView: View {
@AppStorage(kTireSizeKey) var tireSize: TireSize = .standard(.iso25_622)
var body: some View {
NavigationView {
List {
Section(header: Text("機材")) {
NavigationLink(destination: TireSettingView(tireSize: $tireSize)) {
HStack {
Text("タイヤ径")
Spacer()
Text(tireSize.label)
.foregroundColor(.secondary)
}
}
NavigationLink(destination: SensorSettingView()) {
Text("センサー")
}
}
Section(header: Text("その他")) {
HStack {
Text("バージョン")
Spacer()
Text(Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String)
.foregroundColor(.secondary)
}
}
}
.listStyle(.insetGrouped)
.navigationTitle("設定")
}
}
}
struct SettingsView_Previews: PreviewProvider {
static var previews: some View {
SettingsView()
}
}