swiftship/internal/skills/data/always-macos/navigation/SKILL.md
macOS navigation patterns: NavigationSplitView, WindowGroup, Settings scene, MenuBarExtra, multiple windows. Use when working on macOS navigation, window management, or scene architecture. Triggers: navigation, NavigationSplitView, WindowGroup, Settings, MenuBarExtra, openWindow.
npx skillsauth add abdullah4ai/apple-dev-docs navigationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
NavigationSplitView {
List(categories, selection: $selectedCategory) { category in
Label(category.name, systemImage: category.icon)
}
.navigationSplitViewColumnWidth(min: 180, ideal: 220)
} detail: {
if let category = selectedCategory {
CategoryDetailView(category: category)
} else {
ContentUnavailableView("Select a Category", systemImage: "sidebar.left")
}
}
.navigationSplitViewStyle(.balanced)
NavigationSplitView {
SidebarView(selection: $selectedGroup)
.navigationSplitViewColumnWidth(min: 180, ideal: 220)
} content: {
ContentListView(group: selectedGroup, selection: $selectedItem)
.navigationSplitViewColumnWidth(min: 250, ideal: 300)
} detail: {
DetailView(item: selectedItem)
}
Users can open multiple instances:
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
.defaultSize(width: 900, height: 600)
}
}
Window("Activity Monitor", id: "activity") {
ActivityView()
}
.defaultSize(width: 400, height: 300)
Auto-wired to Cmd+, menu:
@main
struct MyApp: App {
var body: some Scene {
WindowGroup { ContentView() }
Settings { SettingsView() }
}
}
@main
struct MyApp: App {
var body: some Scene {
MenuBarExtra("Status", systemImage: "circle.fill") {
StatusMenuView()
}
.menuBarExtraStyle(.window)
}
}
@Environment(\.openWindow) var openWindow
@Environment(\.dismissWindow) var dismissWindow
Button("Open Monitor") {
openWindow(id: "activity")
}
NavigationStack {
List(items) { item in
NavigationLink(value: item) {
ItemRow(item: item)
}
}
.navigationTitle("Items")
.navigationDestination(for: Item.self) { item in
ItemDetailView(item: item)
}
}
TabView {
Tab("Library", systemImage: "books.vertical") {
LibraryView()
}
Tab("Search", systemImage: "magnifyingglass") {
SearchView()
}
Tab("Settings", systemImage: "gear") {
SettingsView()
}
}
.tabViewStyle(.sidebarAdaptable)
CommandMenu closures run outside the view hierarchy — use @FocusedValue to wire them to view state.
@main
struct MyApp: App {
@FocusedValue(\.activeItems) private var items
var body: some Scene {
WindowGroup { ContentView() }
CommandMenu("Items") {
Button("New Item") { items?.create() }
.keyboardShortcut("n", modifiers: .command)
.disabled(items == nil)
Button("Delete Item") { items?.deleteSelected() }
.keyboardShortcut(.delete, modifiers: .command)
.disabled(items == nil)
}
CommandGroup(replacing: .newItem) {
Button("New Document") { items?.create() }
.keyboardShortcut("n", modifiers: .command)
.disabled(items == nil)
}
}
}
// In the active view: .focusedValue(\.activeItems, viewModel) to publish state
// FocusedValues key: extension FocusedValues { @Entry var activeItems: ItemsViewModel? }
.sheet(isPresented: $showEditor) {
EditorView()
.frame(minWidth: 400, minHeight: 300)
}
fullScreenCover — use .sheet or open a new WindowUINavigationController — SwiftUI onlyNavigationSplitView as primary navigation (2 or 3 columns)WindowGroup for main window, Window(id:) for utility windowsSettings scene for preferences (auto-wires Cmd+,)MenuBarExtra for menu bar appsopenWindow(id:) / dismissWindow(id:) for window management.tabViewStyle(.sidebarAdaptable) for sidebar tabsCommandMenu / CommandGroup for system menu bar customization.presentationDetents or frame constraints on .sheettesting
Use for 3D games: racing, 3D sports, board games, marble maze, tower defense, bowling. SceneKit + SceneView architecture, 3D scene hierarchy, physics, game loop, primitives, materials, cameras, particles, audio.
documentation
Game UI patterns: SwiftUI HUD overlays on SpriteKit, menus (main/pause/game-over), virtual joystick/d-pad, score displays, health bars, tutorial onboarding.
tools
Download free game sprites/textures/3D models and generate procedural assets. Covers nw_download_asset tool, texture factories, sprite atlas organization, 3D model loading, and programmatic asset creation.
testing
Use for 2D games: arcade, puzzle, sports, ping pong, platformer, shooter, 2D racing. SpriteKit + SpriteView architecture, scene hierarchy, physics, game loop, audio, particles, game feel.