Files
iceglass/IceGlass-iOS/Views/SettingsSheet.swift
T
rzen aaffa3771c Add iPhone target with shared data layer and persistent cache
Two-target restructure: shared sources (models, services, settings,
extensions, team logos) move into Shared/, consumed by both the
existing macOS menu bar app and a new iOS app. MainService no longer
imports AppKit — platform code attaches via a MainServiceObserver
protocol (MacObserverAdapter wires back to MenuManager / StatusItemManager
/ NotificationManager).

iPhone app is a single SwiftUI page mirroring the macOS menu (playoff
round + yesterday/today/tomorrow), with a gear-icon settings sheet
(display option + IndieAbout for license/changelog). Persistent JSON
snapshot in Application Support paints last-known data on cold launch;
"Updated …" header escalates secondary → orange (>5min) → red (>30min)
so staleness is visually unmistakable. Foreground polling, scenePhase
refresh, and pull-to-refresh; no notifications on iOS in v1.
2026-04-25 06:34:36 -04:00

55 lines
1.7 KiB
Swift

//
// SettingsSheet.swift
// IceGlass-iOS
//
// Copyright 2026 Rouslan Zenetl. All Rights Reserved.
//
import IndieAbout
import SwiftUI
struct SettingsSheet: View {
@Environment(ScoreboardViewModel.self) private var viewModel
@Environment(\.dismiss) private var dismiss
var body: some View {
@Bindable var vm = viewModel
NavigationStack {
Form {
Section("Display") {
Picker("Days shown", selection: Binding(
get: { vm.displayOption },
set: { newValue in
vm.displayOption = newValue
MainService.shared.updateUI()
}
)) {
ForEach(AppSettings.DisplayOption.allCases, id: \.self) { option in
Text(option.title).tag(option)
}
}
.pickerStyle(.inline)
.labelsHidden()
}
Section {
IndieAbout(configuration: AppInfoConfiguration(
showDeviceInfo: false,
documents: [
.license(filename: "LICENSE", extension: "md"),
.custom(title: "Changelog", filename: "CHANGELOG", extension: "md")
]
))
}
}
.navigationTitle("Settings")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button("Done") { dismiss() }
}
}
}
}
}