- Initialize iOS project with 6-tab navigation structure - Configure custom Light/Dark themes and AppColors - Define SwiftData models for Tasks, Tags, Goals, and TrackingRecords - Setup relationships (Super/Sub tags) and cascade delete rules - Implement Observable TrackingEngine for real-time timer updates
63 lines
2.4 KiB
Swift
63 lines
2.4 KiB
Swift
import SwiftUI
|
|
|
|
struct SettingsTabView: View {
|
|
@Environment(AppPreferences.self) private var preferences
|
|
|
|
var body: some View {
|
|
@Bindable var prefs = preferences
|
|
NavigationStack {
|
|
Form {
|
|
Section(String(localized: "settings.section.appearance")) {
|
|
Picker(String(localized: "settings.theme"), selection: $prefs.themeMode) {
|
|
ForEach(ThemeMode.allCases) { mode in
|
|
Text(mode.localizedName).tag(mode)
|
|
}
|
|
}
|
|
}
|
|
|
|
Section(String(localized: "settings.section.language")) {
|
|
Picker(String(localized: "settings.language"), selection: $prefs.languageCode) {
|
|
Text("한국어").tag("ko")
|
|
Text("English").tag("en")
|
|
}
|
|
}
|
|
|
|
Section(String(localized: "settings.section.calendar")) {
|
|
Picker(String(localized: "settings.week_start"), selection: $prefs.weekStartDay) {
|
|
Text(String(localized: "weekday.sunday")).tag(1)
|
|
Text(String(localized: "weekday.monday")).tag(2)
|
|
Text(String(localized: "weekday.saturday")).tag(7)
|
|
}
|
|
Stepper(value: $prefs.dayStartHour, in: 0...23) {
|
|
HStack {
|
|
Text(String(localized: "settings.day_start"))
|
|
Spacer()
|
|
Text(String(format: "%02d:00", prefs.dayStartHour))
|
|
.foregroundStyle(Color.tfMuted)
|
|
}
|
|
}
|
|
}
|
|
|
|
Section {
|
|
NavigationLink {
|
|
// TODO: premium paywall in milestone 3+
|
|
Text(String(localized: "premium.coming_soon"))
|
|
.foregroundStyle(Color.tfMuted)
|
|
} label: {
|
|
Label(String(localized: "settings.premium"), systemImage: "star.fill")
|
|
.foregroundStyle(Color.tfAccent)
|
|
}
|
|
}
|
|
}
|
|
.scrollContentBackground(.hidden)
|
|
.background(Color.tfBackground)
|
|
.navigationTitle(String(localized: "tab.settings"))
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
SettingsTabView()
|
|
.environment(AppPreferences())
|
|
}
|