swiftui-patterns

Guide SwiftUI state management with Observation framework and type-safe navigation.

1|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/vrcms/everything-qwen-code --skill swiftui-patterns-vrcms
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-patterns
Source: https://github.com/vrcms/everything-qwen-code/tree/main/.qwen/skills/swiftui-patterns
Command: npx skills add https://github.com/vrcms/everything-qwen-code --skill swiftui-patterns-vrcms

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of managing state and navigation in modern SwiftUI applications, helping developers avoid common anti-patterns and performance bottlenecks.

Core Features & Use Cases

  • State Management: Provides guidance on using the Observation framework and choosing the correct property wrappers like @Observable and @Bindable.
  • Architecture: Offers patterns for view composition, type-safe navigation using NavigationStack, and efficient dependency injection.
  • Performance: Includes best practices for rendering optimization, such as using lazy containers and stable identifiers to prevent unnecessary view invalidations.

Quick Start

Use the swiftui-patterns skill to refactor my current view model to use the @Observable macro and optimize the navigation flow.

Frequently Asked Questions about swiftui-patterns

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

FAQPage Schema
How do I migrate my SwiftUI views from ObservableObject to the @Observable macro?

Type-safe navigation in SwiftUI uses NavigationStack to manage routing. It provides programmatic control over path management, allowing you to push and pop views securely while avoiding complex view hierarchy anti-patterns.

How do I optimize SwiftUI rendering performance for complex view hierarchies?

Optimize SwiftUI rendering by using lazy containers to load views on demand and assigning stable identifiers to prevent unnecessary view invalidations. These performance techniques ensure smooth declarative user interfaces on Apple platforms.

Can I use @Bindable for state management in my macOS and iOS apps?

You can use @Bindable for state management across iOS and macOS apps. It works seamlessly with the @Observable macro to create bindings in your SwiftUI views, ensuring correct data flow without legacy wrappers.

What is the best way to handle dependency injection in modern SwiftUI architecture?

The best way to handle dependency injection in modern SwiftUI architecture involves passing dependencies through the environment using @Observable models. This pattern ensures efficient data propagation and testability without creating tightly coupled components.