swiftui-best-practices
SwiftUI 最佳实践
本技能提供 SwiftUI 开发的标准工作流程和最佳实践。
核心原则
- 单一数据源 - 状态管理清晰,数据流向明确
- 值类型语义 - 充分利用 struct 的值类型特性
- 声明式 UI - 视图是状态的函数
- 组合优于继承 - 通过组合构建可复用组件
- 性能优先 - 避免不必要的视图重建
状态管理
属性包装器选择指南
More from creeveliu/ios-skills
objective-c-language
Objective-C language best practices. Use this skill whenever the user mentions Objective-C, ObjC, OC, working with legacy iOS code, ARC, Blocks, Categories, Protocols, Runtime, or Swift interoperability.
15code-style-guide
iOS code style guide for Swift and Objective-C. Use this skill whenever the user mentions code style, formatting, naming conventions, code organization, Swift/Objective-C coding standards, indentation, comments, or needs to enforce consistent code quality across the project. This skill covers formatting rules, naming patterns, documentation standards, and file organization.
5uikit-best-practices
UIKit development best practices. Use this skill whenever the user mentions UIKit, UIViewController, Auto Layout, UITableView, UICollectionView, or needs guidance on iOS UI implementation using UIKit with Swift.
5user-experience
iOS user experience best practices. Use this skill whenever the user mentions UX, user experience, animations, haptic feedback, accessibility, localization, dark mode, or app polish.
4swift-language
Swift language best practices. Use this skill whenever the user mentions Swift programming, Swift syntax, memory management, async/await, generics, protocols, or needs guidance on writing idiomatic Swift code.
4app-stability
iOS app stability and crash prevention best practices. Use this skill whenever the user mentions crashes, stability, exception handling, thread safety, error handling, defensive programming, or app reliability.
4