Covers the modern SwiftUI stack with @Observable instead of the older ObservableObject approach, which matters because property-level change tracking means fewer unnecessary view re-renders. You get patterns for state management (when to use @State vs @Binding vs @Environment), type-safe navigation with NavigationPath and enums, and performance tips like lazy containers and avoiding heavy work in body. The Router pattern and dependency injection examples are clean. Honestly most useful if you're already past the basics and want to structure a real app without fighting SwiftUI's quirks or cargo-culting outdated tutorials that still use @Published everywhere.

skills.sh installs
5.2K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill swiftui-patterns --agent claude-code

Installs 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:

WrapperUse Case
@StateView-local value types (toggles, form fields, sheet presentation)
@BindingTwo-way reference to parent's @State
@Observable class + @StateOwned model with multiple properties
@Observable class (no wrapper)Read-only reference passed from parent
@BindableTwo-way binding to an @Observable property
@EnvironmentShared dependencies injected via .environment()

@Observable ViewModel

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Category
Mobile Development

More from affaan-m/everything-claude-code

All 256
1affaan-m avatarswift-actor-persistenceaffaan-m/everything-claude-codeswift actor persistence5Kskills.sh installs
2affaan-m avatarswift-protocol-di-testingaffaan-m/everything-claude-codeswift protocol di testing5Kskills.sh installs
3affaan-m avatarswift-concurrency-6-2affaan-m/everything-claude-codeswift concurrency 6 24.9Kskills.sh installs
4forcedotcom avatarmobile-platform-native-capabilities-integrateforcedotcom/sf-skillsBuild a Salesforce LWC that uses native mobile device capabilities — barcode scanner, biometrics, location, NFC, calendar, contacts, document scanner, geofencin4.7Kskills.sh installs
5forcedotcom avatarmobile-platform-offline-validateforcedotcom/sf-skillsReview a Lightning Web Component for **mobile offline** compatibility — the Komaci offline static analyzer that pre-primes the data graph for Salesforce Mobile 4.7Kskills.sh installs
6affaan-m avatarflutter-dart-code-reviewaffaan-m/everything-claude-codeflutter dart code review4.7Kskills.sh installs