
Swiftui Patterns
Covers modern SwiftUI architecture with the Observation framework, showing you when to use @State versus @Observable versus @Binding, and how to structure view models that only trigger re-renders for the properties that actually changed. The navigation section gives you type-safe routing with NavigationStack and a Router pattern. Performance guidance is practical: lazy containers, stable IDs, keeping expensive work out of body, and selective Equatable conformance. If you're still using ObservableObject and @Published, this walks you through the migration. The state management decision table alone is worth having around when you're wiring up a new feature.
- skills.sh installs
- 5.6K
- GitHub stars
- 300.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add affaan-m/ecc --skill swiftui-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
SwiftUI Patterns
Modern SwiftUI patterns for building declarative, performant user interfaces on Apple platforms. Covers the Observation framework, view composition, type-safe navigation, and performance optimization.
When to Activate
- Building SwiftUI views and managing state (
@State,@Observable,@Binding) - Designing navigation flows with
NavigationStack - Structuring view models and data flow
- Optimizing rendering performance for lists and complex layouts
- Working with environment values and dependency injection in SwiftUI
State Management
Property Wrapper Selection
Choose the simplest wrapper that fits:
| Wrapper | Use Case |
|---|---|
@State | View-local value types (toggles, form fields, sheet presentation) |
@Binding | Two-way reference to parent's @State |
@Observable class + @State | Owned model with multiple properties |
@Observable class (no wrapper) | Read-only reference passed from parent |
@Bindable | Two-way binding to an @Observable property |
@Environment | Shared dependencies injected via .environment() |
@Observable ViewModel
Sponsors
Details
- Repository
- github.com/affaan-m/ecc
- Categories
- Code Review & Quality, Debugging, Mobile Development
- First seen
- Jul 14, 2026
More from affaan-m/ecc
All 263- Github Ops5.6K
- Autonomous Loops5.6K
- Data Scraper Agent5.6K
- Springboot Verification5.6K
- Django Verification5.6K
- Django Celery5.6K
- Dotnet Patterns5.6K
- Blueprint5.5K
- Ecc Guide5.5K
- Code Tour5.5K
- Nuxt4 Patterns5.5K
- Healthcare Phi Compliance5.5K
- Inventory Demand Planning5.5K
- Agentic Os5.5K
- Product Capability5.5K
- Security Bounty Hunter5.5K
- Ai First Engineering5.5K
- Prisma Patterns5.5K
- Continuous Agent Loop5.5K
- Continuous Learning5.5K
- Agent Eval5.5K
- Exa Search5.5K
- Agent Sort5.5K
- Product Lens5.5K