swiftui-views

Standardize SwiftUI view architecture with container/presentational split and @Observable view models.

1|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/dimitriRemoiville/cc-mobile --skill swiftui-views-dimitriremoiville
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-views
Source: https://github.com/dimitriRemoiville/cc-mobile/tree/main/plugins/cc-mobile-ios/skills/swiftui-views
Command: npx skills add https://github.com/dimitriRemoiville/cc-mobile --skill swiftui-views-dimitriremoiville

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Authoritative playbook for building SwiftUI views and view models in this project, ensuring consistent architecture, state ownership, and reusable UI patterns across screens.

Core Features & Use Cases

  • Container / presentational split: Root view owns the world and state, while a pure presentation view renders UI from state.
  • @Observable view models: Centralized, testable state management with compile-time safety.
  • Typed navigation and previews: Guided navigation routing and fully previewable UI components.
  • Accessibility and performance best practices: Built-in guidance for accessibility labels and efficient rendering.
  • Use Case: Implement a profile screen with a root container and a presentational view, wired to a ViewModel that loads data and handles navigation callbacks.

Quick Start

Create a Root container and a stateless presentation view following the container/presentational split, wiring an @Observable view model and a minimal navigation path.

Frequently Asked Questions about swiftui-views

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

FAQPage Schema
How do I structure SwiftUI views with @Observable view models?

Apply the container/presentational split where a Root view owns state and a pure presentation view renders UI, using an @Observable view model to centralize state and ensure compile-time safety.

What is the container/presentational split pattern in SwiftUI?

The container/presentational split in SwiftUI separates a Root view that owns state and data from a pure presentation view that renders UI, ensuring reusable and testable components across screens.

How do I implement typed navigation in SwiftUI?

Implement typed navigation in SwiftUI by using guided navigation routing with a minimal navigation path, managed through an @Observable view model to handle navigation callbacks safely.

Can I build stateless presentation views that support SwiftUI previews?

Yes, the architecture enforces fully previewable UI components by using stateless presentation views that render purely from state, allowing robust previews without requiring the full Root container.

How do I add accessibility labels to SwiftUI presentation views?

Add accessibility labels to SwiftUI presentation views by following the built-in accessibility best practices provided in the architecture playbook, ensuring efficient rendering and robust support.

When should I use an @Observable view model instead of local SwiftUI state?

Use an @Observable view model when you need centralized, testable state management with compile-time safety across screens, rather than isolated local state within individual views.