Skip to content
affaan-m avatar

Swiftui Patterns

SwiftUI architecture patterns with @Observable state, type-safe navigation, and render performance guidance for Apple platforms.

CCM score
75 of 100
skills.sh installs
12.4K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers property wrapper selection, @Observable view models, view composition, NavigationStack routing, and performance tuning for lists
  • Includes code examples for @Observable view models, @Environment injection, a Router with NavigationPath, ViewModifier styling, and #Preview mock data
  • Enforces avoiding ObservableObject, @Published, and @EnvironmentObject in new code, and keeps async work out of body and init
  • Designed for developers building or reviewing SwiftUI views on iOS and macOS who need current state management guidance

Install

$ npx -y skills add affaan-m/ecc --skill swiftui-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

Repository
github.com/affaan-m/ecc
Categories
Mobile Apps, Frontend & UI Code
First seen
Jul 14, 2026

Questions

What does the swiftui-patterns skill do?

The swiftui-patterns skill guides building SwiftUI views with @Observable state, view composition, type-safe NavigationStack routing, and render performance tuning. It covers modern iOS and macOS UI practices, such as replacing ObservableObject with @Observable and using #Preview with mock data.

Where does swiftui-patterns rank in the Mobile Apps category?

On the Mobile Apps category page, swiftui-patterns ranks in the top 100. It sits alongside skills such as vercel-react-native-skills, animate-expo, write-swift, firebase-crashlytics and xcode-project-setup, and it focuses on SwiftUI architecture, state, navigation and performance.

How do I install the swiftui-patterns skill?

Run npx -y skills add affaan-m/ecc --skill swiftui-patterns -y in your project to install it. Once installed, the agent can help you build and review SwiftUI views, @Observable view models, NavigationStack flows and list rendering performance.

When should I use the swiftui-patterns skill?

Use swiftui-patterns when building or reviewing SwiftUI views, @Observable state, navigation or render performance. It helps you choose between @State, @Binding, @Bindable and @Environment, and it flags anti-patterns such as async work inside body or using AnyView.

More from affaan-m/ecc

All 257

Similar to Swiftui Patterns

More Mobile Apps