mycode/myApp/Keging/IOS/AppSettingsView.swift
songyc macbook 9c9df03571 polish(keging): 메인·운동 화면 그래픽 강화 + 도움말 취소선(마크다운 ~) 수정
- 메인: 텍스트 한 줄 요약 → 수축·이완·횟수 카드 3장(아이콘+큰 숫자, 탭=세팅)
- 운동 화면: 국면 색 전환(수축=그린·이완=앰버, 카운터 색 연동) + 세트 진행 링 +
  큰 현재 횟수 카운터(numericText 전환)
- 도움말 취소선 원인 = SwiftUI Text 마크다운의 ~쌍 해석 — 사용자 문구의 ASCII ~를
  전각 ~로 전면 교체(4곳), CLAUDE.md에 금지 규칙 기록
- 신규 QA 인자 -noHealth(권한 시트가 캡처 가리는 것 방지)
- 검증: Debug·Release 빌드 그린, 화면 QA(메인 카드·수축/이완 국면·도움말), 카탈로그 0/0

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UPmp29DQHY6Ahfss5SRopT
2026-08-29 20:49:30 +09:00

95 lines
4.0 KiB
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// AppSettingsView.swift
// Keging
//
//
//
import SwiftUI
struct AppSettingsView: View {
@EnvironmentObject private var settings: SettingsStore
@AppStorage("app.theme", store: AppGroup.defaults) private var themeMode = "system"
@AppStorage("app.language", store: AppGroup.defaults) private var appLanguage = "system"
@Environment(\.dismiss) private var dismiss
var body: some View {
NavigationStack {
Form {
Section("테마") {
Picker("화면 모드", selection: $themeMode) {
Text("시스템").tag("system")
Text("라이트").tag("light")
Text("다크").tag("dark")
}
.pickerStyle(.segmented)
}
Section {
Picker("언어", selection: $appLanguage) {
Text("시스템").tag("system")
Text(verbatim: "한국어").tag("ko")
Text(verbatim: "English").tag("en")
Text(verbatim: "日本語").tag("ja")
}
} header: {
Text("언어")
} footer: {
Text("언어를 바꾸면 앱을 완전히 종료했다가 다시 실행했을 때 적용돼요.")
}
Section {
Picker("운동 유형", selection: $settings.config.healthWorkoutType) {
ForEach(HealthWorkoutType.allCases) { Text($0.label).tag($0) }
}
Picker("운동 강도 자동 기록", selection: $settings.config.effortScore) {
Text("안 함").tag(0)
ForEach(1...10, id: \.self) { score in
Text(effortLabel(score)).tag(score)
}
}
} header: {
Text("애플 건강")
} footer: {
Text("운동을 끝까지 마치면 그 시간이 위에서 고른 유형으로 애플 건강에 자동 기록되고, 운동 강도(110)도 함께 저장돼요. 기록을 원치 않으면 건강 앱에서 케깅의 권한을 끄면 돼요.")
}
Section {
LabeledContent("버전", value: versionText)
} footer: {
Text("케깅은 광고와 결제가 없는 완전 무료 앱이에요.")
}
}
.navigationTitle("설정")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .confirmationAction) {
Button("완료") { dismiss() }
}
}
.onChange(of: appLanguage) {
// ( )
if appLanguage == "system" {
UserDefaults.standard.removeObject(forKey: "AppleLanguages")
} else {
UserDefaults.standard.set([appLanguage], forKey: "AppleLanguages")
}
}
}
}
/// : 1~3 · 4~6 · 7~8 · 9~10
private func effortLabel(_ score: Int) -> String {
let word: String = switch score {
case 1...3: String(localized: "쉬움")
case 4...6: String(localized: "보통")
case 7...8: String(localized: "힘듦")
default: String(localized: "전력")
}
return String(localized: "\(score) · \(word)")
}
private var versionText: String {
let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "1.0"
let build = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? "1"
return "\(version) (\(build))"
}
}