Build a settings screen the right way (iOS 17+)
何時使用: You want a Settings screen that's actually idiomatic for iOS 17+.
前置條件
- Server/skill installed and authenticated — See repo README
步驟
-
PlanUsing the SwiftUI skill, design a Settings view with sections: Account, Notifications, About. Use @Observable for the view model.✓ 已複製→ View hierarchy + ViewModel sketch
-
CodeWrite the full file with toggles, NavigationLink to subpages, and a confirmation dialog for sign-out.✓ 已複製→ Compiles on Xcode 15+
結果: Idiomatic SwiftUI you don't have to rewrite next year.
注意事項
- Don't mix @StateObject with @Observable — Don't mix @StateObject with @Observable — the skill enforces one or the other; follow it.