swiftui-observable

Migrate ObservableObject models to @Observable for fine-grained SwiftUI view updates.

4|1|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/AutisticAF/claude-code-apple-dev-plugin --skill swiftui-observable
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-observable
Source: https://github.com/AutisticAF/claude-code-apple-dev-plugin/tree/main/skills/swiftui-observable
Command: npx skills add https://github.com/AutisticAF/claude-code-apple-dev-plugin --skill swiftui-observable

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps SwiftUI developers migrate from ObservableObject patterns and design class-based state models that provide fine-grained view updates, reducing unnecessary redraws and boilerplate.

Core Features & Use Cases

  • Migration steps and practical patterns to replace ObservableObject, @Published, @StateObject, and @ObservedObject with @Observable and @State.
  • Guidance for two-way bindings with @Bindable, excluding properties with @ObservationIgnored, injecting models via Environment, and using @MainActor for UI safety.
  • Interoperability notes for SwiftData @Model, bridging legacy code, and advice for minimizing redraw scope in complex views.

Quick Start

Migrate your ObservableObject-based view model to @Observable, remove @Published annotations, replace @StateObject with @State, and update views to use @Bindable or plain properties for bindings.

Frequently Asked Questions about swiftui-observable

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

FAQPage Schema
How do I migrate ObservableObject to @Observable in SwiftUI?

To migrate ObservableObject to @Observable, remove @Published annotations, replace @StateObject with @State, and update views to use @Bindable for two-way bindings, targeting iOS 17+.

What is the best way to create two-way bindings with @Observable in SwiftUI?

Use @Bindable in your SwiftUI views to create two-way bindings from @Observable models. This allows fine-grained view updates without the boilerplate of @Published.

How do I reduce unnecessary redraws in SwiftUI views?

Reduce unnecessary redraws by using @Observable for fine-grained updates and @ObservationIgnored to exclude properties that should not trigger view redraws.

Does @Observable work with SwiftData @Model in iOS 17?

@Observable interoperates with SwiftData @Model. You need compatibility guidance to avoid improper stacking and ensure correct environment injection for UI safety.

Why should I use @MainActor with @Observable in SwiftUI?

Use @MainActor with @Observable models to ensure UI safety during state updates. This prevents concurrent access issues when injecting models via the Environment.