ios-swiftui
Standards for declarative UI construction and data flow in iOS. Use when building declarative SwiftUI views or managing data flow with property wrappers. (triggers: **/*View.swift, View, State, Binding, EnvironmentObject)
Best use case
ios-swiftui is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Standards for declarative UI construction and data flow in iOS. Use when building declarative SwiftUI views or managing data flow with property wrappers. (triggers: **/*View.swift, View, State, Binding, EnvironmentObject)
Teams using ios-swiftui should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ios-swiftui/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How ios-swiftui Compares
| Feature / Agent | ios-swiftui | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Standards for declarative UI construction and data flow in iOS. Use when building declarative SwiftUI views or managing data flow with property wrappers. (triggers: **/*View.swift, View, State, Binding, EnvironmentObject)
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# SwiftUI Expert ## **Priority: P0 (CRITICAL)** **You are an iOS UI Expert.** Prioritize smooth 60fps rendering and clean data flow. ## Implementation Guidelines - **Views**: Small, composable structs. Extract subviews often to keep the `body` clean. - **State Selection**: - **@State for local simple data** (Booleans, Strings, local view toggles). - **@StateObject for VMs** (initialized only once in the parent view). - **@ObservedObject for passed-in VMs** (initialized by a parent). - **Modifiers**: Order matters sequentially. Apply layout modifiers before visual ones (e.g., `.padding().background()`). - **Preview**: Always provide a `PreviewProvider` or `#Preview` for every view. ## Verification Checklist (Mandatory) - [ ] **Body Property**: Is the **body property computationally cheap**? (No complex logic or calculations). - [ ] **State Flow**: `@StateObject` initialized only once (in parent)? - [ ] **Identity**: Do Lists/ForEach have stable `id`? - [ ] **Main Actor**: Are UI updates strictly on the **Main Actor**? ## Anti-Patterns - **No Logic in Body**: Move calculations to **ViewModel or computed vars**. Keep `body` for UI composition only. - **No ObservedObject Init**: Do **NOT** init `@ObservedObject` inside the View settings — this causes leaks and performance issues. - **No Hardcoded Sizes**: Use flexible frames and spacers for responsive UI. ## References - [SwiftUI Views & State](references/example.md)
Related Skills
Expo UI SwiftUI
`@expo/ui/swift-ui` package lets you use SwiftUI Views and modifiers in your app.
swiftui-view-refactor
Refactor and review SwiftUI view files for consistent structure, dependency injection, and Observation usage. Use when asked to clean up a SwiftUI view’s layout/ordering, handle view models safely (non-optional when possible), or standardize how dependencies and @Observable state are initialized and passed.
swiftui-ui-patterns
Best practices and example-driven guidance for building SwiftUI views and components. Use when creating or refactoring SwiftUI UI, designing tab architecture with TabView, composing screens, or needing component-specific patterns and examples.
swiftui-performance-audit
Audit and improve SwiftUI runtime performance from code review and architecture. Use for requests to diagnose slow rendering, janky scrolling, high CPU/memory usage, excessive view updates, or layout thrash in SwiftUI apps, and to provide guidance for user-run Instruments profiling when code review alone is insufficient.
swiftui-liquid-glass
Implement, review, or improve SwiftUI features using the iOS 26+ Liquid Glass API. Use when asked to adopt Liquid Glass in new SwiftUI UI, refactor an existing feature to Liquid Glass, or review Liquid Glass usage for correctness, performance, and design alignment.
swiftui-patterns
SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.
swift-swiftui
Standards for State Management, View Lifecycle, and Property Wrappers. Use when managing SwiftUI state, view lifecycle, or property wrappers like @State and @Binding. (triggers: **/*.swift, @State, @Binding, @ObservedObject, View, body)
axiom-swiftui-search-ref
Use when implementing SwiftUI search — .searchable, isSearching, search suggestions, scopes, tokens, programmatic search control (iOS 15-18). For iOS 26 search refinements (bottom-aligned, minimized toolbar, search tab role), see swiftui-26-ref.
axiom-swiftui-performance
Use when UI is slow, scrolling lags, animations stutter, or when asking 'why is my SwiftUI view slow', 'how do I optimize List performance', 'my app drops frames', 'view body is called too often', 'List is laggy' - SwiftUI performance optimization with Instruments 26 and WWDC 2025 patterns
axiom-swiftui-nav
Use when implementing navigation patterns, choosing between NavigationStack and NavigationSplitView, handling deep links, adopting coordinator patterns, or requesting code review of navigation implementation - prevents navigation state corruption, deep link failures, and state restoration bugs for iOS 18+
axiom-swiftui-nav-ref
Reference — Comprehensive SwiftUI navigation guide covering NavigationStack (iOS 16+), NavigationSplitView (iOS 16+), NavigationPath, deep linking, state restoration, Tab+Navigation integration (iOS 18+), Liquid Glass navigation (iOS 26+), and coordinator patterns
axiom-swiftui-nav-diag
Use when debugging navigation not responding, unexpected pops, deep links showing wrong screen, state lost on tab switch or background, crashes in navigationDestination, or any SwiftUI navigation failure - systematic diagnostics with production crisis defense