LaunchKit · 2026
Back to Skills

swiftui-ui-patterns

Best practices and example-driven guidance.

4
2.9k downloads
by @dimillian

Setup & Installation

openclaw skills install @dimillian/swiftui-ui-patterns

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install swiftui-ui-patterns

Version History

v1.0.2Jan 9, 2026 - Version note by skill developer:

- Added macOS settings and menu

What This Skill Does

Opinionated guidance for building SwiftUI views using modern state management, composition, and navigation patterns. Covers TabView architecture, NavigationStack wiring, sheet presentation, and async data loading. Targets both new project scaffolding and incremental work on existing codebases.

Encodes SwiftUI-specific pitfalls (sheet ownership, state locality, async patterns) that generic Swift guidance omits, reducing time spent debugging avoidable mistakes.

When to use it

  • Setting up TabView with NavigationStack in a new iOS app
  • Refactoring a view model-heavy screen to use @Observable
  • Implementing a sheet driven by a selected model item
  • Adding async loading states to a SwiftUI list view
  • Structuring a multi-tab app with typed route enums

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: Add an edit sheet to my SwiftUI list screen

AGENT
  1. 1Read the existing list view to identify current state and navigation patterns
  2. 2Choose item-driven sheet pattern using .sheet(item:) with a @State private var selectedItem
  3. 3Scaffold EditItemSheet with @Environment(\.dismiss) and an internal save() async function
  4. 4Wire the sheet modifier to the list view and pass the selected item
  5. 5Validate the build and check that dismiss() is called after the async action completes
OUTPUT

A list view with a working item-driven edit sheet that owns its save action and dismisses itself on completion