swiftui-best-practices
CommunityMaster SwiftUI with clean, scalable patterns.
Authorrsaccone
Version1.0.0
Installs0
System Documentation
What problem does it solve?
SwiftUI projects often accumulate tangled state, deep view hierarchies, and ad-hoc navigation that hinder maintainability and testability. This guide codifies best practices to keep state predictable, promote small reusable views, and establish robust navigation patterns.
Core Features & Use Cases
- Stateless views by default; place business logic in a ViewModel or model layer and bind to simple state.
- Favor small, composable view components; extract large bodies into private nested views for readability.
- Use stable identities in lists and typed navigation; avoid using indices or string-based routes.
- Prefer NavigationStack (and NavigationSplitView on supported platforms) for contemporary navigation and clear routing boundaries.
- Address performance and accessibility: keep body pure, provide meaningful labels, and design tappable areas with sufficient padding.
Quick Start
Refactor an existing SwiftUI screen to move business logic into a minimal ViewModel, extract large bodies into private subviews, and adopt a typed NavigationStack-based flow.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: swiftui-best-practices Download link: https://github.com/rsaccone/AISkills/archive/main.zip#swiftui-best-practices Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.