ios-design
42
总安装量
5
周安装量
#9186
全站排名
安装命令
npx skills add https://github.com/pproenca/dot-skills --skill ios-design
Agent 安装分布
claude-code
5
amp
4
gemini-cli
4
github-copilot
4
codex
4
kimi-cli
4
Skill 文档
Apple SwiftUI iOS Design Best Practices
Comprehensive guide for building Apple-quality iOS UIs with SwiftUI. Contains 62 rules across 8 categories covering design systems, state management, layout, view composition, navigation, components, accessibility, and animation polish.
When to Apply
Reference these guidelines when:
- Building new SwiftUI views and screens
- Implementing design systems with semantic colors, typography, and spacing
- Managing state with @State, @Binding, @Observable, @Environment
- Laying out content with stacks, grids, and adaptive layouts
- Composing views with @ViewBuilder and custom modifiers
- Implementing navigation with NavigationStack, TabView, sheets
- Choosing and configuring SwiftUI components
- Ensuring VoiceOver support, touch targets, and reduce motion
- Adding semantic transitions and loading state animations
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Design System | CRITICAL | design- |
| 2 | State & Data Flow | CRITICAL | state- |
| 3 | Layout & Sizing | HIGH | layout- |
| 4 | View Composition | HIGH | view- |
| 5 | Navigation | HIGH | nav- |
| 6 | Components & Controls | HIGH | comp- |
| 7 | Accessibility | HIGH | access- |
| 8 | Animation & Polish | MEDIUM | anim- |
Quick Reference
1. Design System (CRITICAL)
design-semantic-colors– Use semantic and system colorsdesign-typography– Use system typography stylesdesign-visual-hierarchy– Establish clear visual hierarchydesign-dark-mode– Support Dark Mode from day onedesign-material-backgrounds– Use material backgrounds for depthdesign-sf-symbols– Use SF Symbols for consistent iconographydesign-safe-areas– Respect safe areas for content layoutdesign-gradients– Apply gradients for visual depthdesign-foreground-style– Use foregroundStyle over foregroundColor
2. State & Data Flow (CRITICAL)
state-local– Use @State for view-local value typesstate-binding– Use @Binding for child view mutationsstate-environment– Use @Environment for shared app datastate-observable– Use @Observable for model classesstate-avoid-in-body– Avoid creating state inside view bodystate-minimize-scope– Minimize state scope to reduce re-rendersstate-bindable– Use @Bindable for @Observable bindings
3. Layout & Sizing (HIGH)
layout-8pt-grid– Use 8pt grid for spacinglayout-readable-width– Constrain text to readable width on iPadlayout-adaptive– Use adaptive layouts for different size classeslayout-standard-margins– Use system standard marginslayout-scroll-indicators– Show scroll indicators for long contentlayout-stacks– Use stacks instead of manual positioninglayout-stack-config– Configure stack alignment and spacinglayout-spacer– Use Spacer for flexible distributionlayout-frame-sizing– Use frame() for explicit size constraintslayout-zstack– Use ZStack for layered view compositionlayout-grid– Use Grid for aligned tabular layoutslayout-lazy-grids– Use LazyVGrid for scrollable grid layouts
4. View Composition (HIGH)
view-body-some-view– Return some View from body propertyview-custom-properties– Use properties to make views configurableview-modifier-order– Apply modifiers in correct orderview-viewbuilder– Use @ViewBuilder for flexible compositionview-prefer-value-types– Prefer value types for view dataview-prefer-composition– Prefer composition over inheritance
5. Navigation (HIGH)
nav-navigationstack– Use NavigationStack for modern navigationnav-tabview– Organize app sections with TabViewnav-sheet-item– Use item binding for sheet presentationnav-dismiss– Use environment dismiss for modal closurenav-toolbar– Place toolbar items correctlynav-tab-bar– Use tab bar for top-level navigationnav-bar– Configure navigation barnav-hierarchy– Design clear navigation hierarchynav-search– Integrate search using searchable modifier
6. Components & Controls (HIGH)
comp-list-vs-lazyvstack– Choose List vs LazyVStack by feature needscomp-sheet-vs-fullscreen– Choose sheet vs fullScreenCovercomp-picker– Choose the right picker stylecomp-grid-vs-lazygrid– Choose Grid vs LazyVGrid by data sizecomp-textfield– Configure text input componentscomp-button– Use appropriate button stylescomp-list-cells– Design list cells with standard layoutscomp-alerts– Use alerts sparingly for critical informationcomp-action-sheets– Use action sheets for contextual choicescomp-segmented– Use segmented controls for exclusive optionscomp-menus– Use menus for secondary actionscomp-content-unavailable– Use ContentUnavailableView for empty states
7. Accessibility (HIGH)
access-voiceover-labels– Add VoiceOver labels to interactive elementsaccess-touch-targets– Ensure minimum 44pt touch targetsaccess-reduce-motion– Respect reduce motion preference
8. Animation & Polish (MEDIUM)
anim-transitions– Use semantic transitions for appearing viewsanim-loading-states– Animate loading and empty statesanim-with-animation– Use withAnimation for explicit state changesanim-matched-geometry– Use matchedGeometryEffect for smooth view transitions
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions – Category structure and impact levels
- Rule template – Template for adding new rules
Reference Files
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |