Builds SwiftUI views with modern MV architecture, state management, and view composition patterns. Covers @Observable ownership rules, @State/@Bindable/@Environment wiring, view decomposition, custom ViewModifiers, environment values, async data loading with .task, iOS 26+ APIs, Writing Tools, and performance guidelines. Use when structuring a SwiftUI app, managing state with @Observable, composing view hierarchies, or applying SwiftUI best practices.
Detected risks:
The `swiftui-patterns` skill provides developers with a structured approach to building SwiftUI applications using modern architectural patterns, state management techniques, and view composition strategies. It addresses common challenges in SwiftUI development, such as organizing large view hierarchies, managing state effectively, and applying best practices for maintainable and performant code. By focusing on the Model-View (MV) pattern, environment wiring, and async data loading, this skill helps ensure that applications remain modular, testable, and scalable while adhering to SwiftUI conventions.
The skill encompasses a range of features designed for SwiftUI developers working on iOS 26+ with Swift 6.3. It covers the use of `@Observable` for state ownership, proper application of `@State`, `@Bindable`, and `@Environment` properties, decomposition of views into reusable subviews, creation of custom `ViewModifiers`, and management of environment values. Additionally, it addresses asynchronous data loading patterns using `.task`, performance optimization guidelines, and integration with platform-specific APIs. The skill also provides guidance for Writing Tools in iOS 18+ and emphasizes alignment with SwiftUI Human Interface Guidelines (HIG) to ensure polished and consistent user interfaces.
This skill is intended for iOS developers seeking to improve their SwiftUI application architecture and adopt best practices in state management and view composition. It is particularly useful for teams maintaining large SwiftUI codebases, developers transitioning to Swift 6.3 and iOS 26+, or anyone looking to structure their apps for maintainability, performance, and testability. By leveraging this skill, users can confidently manage app state, compose complex views, and adopt modern SwiftUI features without introducing unnecessary complexity or breaking established MV patterns.
While the skill targets iOS 26+ APIs, many patterns and concepts, such as MV architecture and state management, are backward-compatible to iOS 17. Certain newer APIs may not be available on earlier versions.
The skill recommends the Model-View (MV) pattern where views remain lightweight and declarative, while models and services handle business logic. Large views should be split into smaller subviews rather than introducing view models unless already present.
All `@Observable` classes should be annotated with `@MainActor` to ensure UI-bound state updates occur on the main thread, which is required for Swift 6 concurrency safety.
No, navigation patterns such as `NavigationStack` and layout components like stacks, grids, and lists are covered in separate skills (`swiftui-navigation` and `swiftui-layout-components`). This skill focuses on architecture, state management, and view composition.
Yes, the skill provides guidance on performance optimization, including efficient state handling, view composition, and async data loading to ensure responsive and maintainable SwiftUI apps.
Quick Setup:
.claude/skills/Repository
dpearson2699/swift-ios-skills