一键导入
navigation-patterns
Navigation patterns: NavigationStack, TabView, split view, deep linking. Use when implementing UI patterns related to navigation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Navigation patterns: NavigationStack, TabView, split view, deep linking. Use when implementing UI patterns related to navigation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
App Clip implementation: separate target, associated domains, URL handling, size limits. Use when implementing app features related to app clips.
Live Activities: ActivityKit, Dynamic Island, Lock Screen widgets, push updates. Use when implementing app features related to live activities.
Safari web extension: content scripts, background scripts, native messaging. Use when implementing app features related to safari extensions.
Share extension: NSExtensionActivationRule, data handling, UI. Use when implementing app features related to share extensions.
SpriteKit 2D game development: SpriteView integration, scene architecture, entity-component system, physics, game loop. Use when building 2D games.
Post-build visual UI/UX review: capture simulator screenshots, evaluate with vision, collect findings, fix issues sequentially. Use after successful builds to ensure visual quality.
基于 SOC 职业分类
| name | navigation-patterns |
| description | Navigation patterns: NavigationStack, TabView, split view, deep linking. Use when implementing UI patterns related to navigation. |
| tags | swiftui, ui-patterns |
| Pattern | When to Use |
|---|---|
NavigationStack | Hierarchical drill-down (list → detail → edit) |
TabView with Tab API | 3+ distinct top-level peer sections |
.sheet(item:) | Creation forms, secondary actions, settings |
.fullScreenCover | Immersive experiences (media player, onboarding) |
NavigationStack + .sheet | Most MVPs with 2-4 features |
Use for hierarchical navigation with a back button:
NavigationStack {
List(items) { item in
NavigationLink(value: item) {
ItemRow(item: item)
}
}
.navigationDestination(for: Item.self) { item in
ItemDetailView(item: item)
}
.navigationTitle("Items")
}
Use when the app has 3+ distinct, peer-level sections:
TabView {
Tab("Home", systemImage: "house") {
HomeView()
}
Tab("Search", systemImage: "magnifyingglass") {
SearchView()
}
Tab("Profile", systemImage: "person") {
ProfileView()
}
}
Choose the right sheet variant based on context:
.sheet(item:) — for editing or viewing an existing item (the item drives the sheet).sheet(isPresented:) — acceptable for creation forms and simple actions (no item yet)// Editing/viewing an existing item — use item-driven
@State private var editingItem: Item?
.sheet(item: $editingItem) { item in
EditItemView(item: item)
}
// Creating a new item — isPresented is fine
@State private var showAddItem = false
.sheet(isPresented: $showAddItem) {
AddItemView()
}
Use for immersive content that should cover the entire screen:
@State private var showOnboarding = false
.fullScreenCover(isPresented: $showOnboarding) {
OnboardingView()
}
Always use navigationDestination(for:) for type-safe routing:
// Define route types
.navigationDestination(for: Note.self) { note in
NoteDetailView(note: note)
}
.navigationDestination(for: Category.self) { category in
CategoryView(category: category)
}