swiftui-patterns

Standardize SwiftUI architecture with @Observable state and iOS 17+ patterns.

1|Updated Jun 24, 2026
One-click install
npx skills add https://github.com/eric-sabe/engsys --skill swiftui-patterns-eric-sabe
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-patterns
Source: https://github.com/eric-sabe/engsys/tree/main/stacks/lang/swift/skills/swiftui-patterns
Command: npx skills add https://github.com/eric-sabe/engsys --skill swiftui-patterns-eric-sabe

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building SwiftUI apps often leads to inconsistent architecture, messy state management, and reliance on deprecated APIs that create technical debt, UI bugs, and maintenance overhead as iOS evolves.

Core Features & Use Cases

  • Modern MV Architecture: Defaults to lightweight Model-View patterns that avoid unnecessary view models, keeping views declarative and easy to test.
  • @Observable State Management: Clear ownership rules and wiring patterns for @State, @Bindable, @Environment, and @Query to eliminate common state-related bugs.
  • Comprehensive Best Practices: Covers view composition, async data loading, iOS 26+ new APIs, HIG-aligned design, Writing Tools integration, and performance optimization.
  • Migration Support: Includes full guidance for moving from legacy ObservableObject/Combine patterns to modern SwiftUI observation.
  • Use Case: If you are building a new iOS 26 SwiftUI app or migrating an existing project from older iOS versions, this skill provides the complete pattern library and validation checklist to ensure consistent, maintainable code.

Quick Start

Use the swiftui-patterns skill to structure your new SwiftUI feed feature with proper @Observable state ownership, async data loading via .task, and decomposed subview composition for maintainability.

Frequently Asked Questions about swiftui-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate from Combine and ObservableObject to modern SwiftUI state management?

Migrating from Combine to modern SwiftUI state management involves replacing ObservableObject with the @Observable macro and updating view observation wiring. This skill provides full migration guidance to eliminate deprecated observation patterns and ensure Swift 6 concurrency compliance.

What is the best way to structure SwiftUI apps with MV architecture without view models?

The best way to structure SwiftUI apps with lightweight MV architecture is using declarative views and @Observable state ownership directly. This skill provides standardized patterns that avoid unnecessary view models, keeping your code maintainable and easy to test.

How do I manage state ownership in SwiftUI using @Observable, @Bindable, and @Environment?

Managing state ownership in SwiftUI requires clear rules for @State, @Bindable, @Environment, and @Query to eliminate common state bugs. This skill provides standardized wiring patterns for iOS 17+ projects to ensure consistent data flow.

Does this SwiftUI pattern library support iOS 26 features and Swift 6 concurrency requirements?

Yes, this SwiftUI pattern library targets iOS 17+ and supports iOS 26+ feature adoption, including Writing Tools integration and HIG-aligned design. It ensures your code complies with Swift 6 concurrency requirements and async data loading via .task.

Why does my SwiftUI view composition cause maintenance issues and deprecated code errors?

SwiftUI view composition causes maintenance issues when architecture is inconsistent and relies on deprecated APIs. This skill provides decomposed subview composition patterns and validation checklists to eliminate technical debt and UI bugs.

When should I not use traditional view models in my SwiftUI iOS app?

You should avoid traditional view models in SwiftUI when adopting modern MV architecture patterns that keep views declarative. This skill provides standardized @Observable state ownership and view composition patterns that eliminate unnecessary view models for better maintainability.