swiftui-patterns

Build native macOS SwiftUI scenes, windows, menus, and settings layouts.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/AarnavBaddam/skills --skill swiftui-patterns-aarnavbaddam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-patterns
Source: https://github.com/AarnavBaddam/skills/tree/main/swiftui-patterns
Command: npx skills add https://github.com/AarnavBaddam/skills --skill swiftui-patterns-aarnavbaddam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? macOS apps built with iOS-style SwiftUI patterns often feel wrong on the desktop: single monolithic windows, missing menu commands, buried settings, and touch-first navigation. This Skill guides you to structure scenes, windows, commands, toolbars, split views, and settings the way native macOS apps do. ## Core Features & Use Cases - Scene and window modeling: Choose correctly between WindowGroup, Window, DocumentGroup, Settings, and MenuBarExtra, including launch behavior for menu-bar-plus-window apps. - Desktop interaction patterns: Implement command menus, keyboard shortcuts, toolbars, sidebars, inspectors, and selection-driven NavigationSplitView layouts. - State ownership guidance: Pick the right wrapper (@State, @Binding, @Observable, @SceneStorage, @AppStorage) based on app-wide, scene-scoped, or window-scoped ownership. - Use Case: You are scaffolding a new macOS utility with a main window, a settings window, and a menu bar extra. The Skill walks you through scene selection, file structure, menu bar label limits, and activation policy so the app behaves like a proper desktop app from the first build. ## Quick Start Ask the AI to scaffold a native macOS SwiftUI app with a sidebar-detail main window, a settings scene, and a menu bar extra using the swiftui-patterns guidance.

Frequently Asked Questions about swiftui-patterns

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

FAQPage Schema
How do I structure a new macOS SwiftUI app with multiple windows?

Use WindowGroup with an id for the primary launch window, Window for auxiliary singleton windows, and a dedicated Settings scene for preferences. Split code into App, Views, Models, Stores, Services, and Support folders rather than one large file.

How do I add menu commands and keyboard shortcuts in SwiftUI on macOS?

Attach a commands modifier at the scene level and use CommandMenu or CommandGroup to define menu items. Pair important commands with keyboardShortcut modifiers and expose them in toolbars or content so they stay discoverable.

Should I use WindowGroup or Window for a menu bar app main window?

Use WindowGroup with an id for the main window when it should appear at launch in a menu-bar-plus-window app. A Window scene is better reserved for auxiliary on-demand windows and may not present the main window automatically at launch.

When should I use AppKit instead of SwiftUI on macOS?

Switch to AppKit interop when you need low-level window control, responder-chain integration, custom panels, or advanced status item behavior that SwiftUI scene and command APIs cannot express cleanly. Try SwiftUI-native scenes and commands first.

Why does my SwiftUI sidebar look wrong on macOS?

Sidebars often look wrong when rows use custom cards, multiple icons, or dense metadata lines, or when opaque background fills override the native source-list material. Keep rows to one icon and one or two text lines and let the system provide the sidebar background.