/ios-swift-skills:swiftui-programming-skillfrom ios-swift-skills
Guides building SwiftUI interfaces with correct view composition, state and Observation ownership, navigation, adaptive layout, toolbars, forms, SF Symbols, accessibility, and previews. Includes platform-specific API choices and availability handling.
Ships in ios-swift-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Build SwiftUI interfaces that are correct for the user's declared platforms and deployment targets. Ask for those targets when an API choice depends on them; never assume the newest SDK is deployable.
The primary examples use Xcode 15, Swift 5.9, and iOS/iPadOS 17 or macOS 14. SwiftUI itself supports older systems, but newer APIs need explicit availability handling:
| Need | Preferred API | Minimum | Compatibility path |
|---|---|---|---|
| Stack navigation | NavigationStack | iOS 16, macOS 13, tvOS 16, watchOS 9 | NavigationView remains valid for earlier targets |
| Observation | @Observable | iOS 17, macOS 14, tvOS 17, watchOS 10 | ObservableObject and @StateObject remain supported |
| Toolbars | .toolbar | iOS 14, macOS 11, tvOS 14, watchOS 7 | Put controls in the view hierarchy on earlier targets |
| Modern change handling | zero- or two-parameter onChange | iOS 17, macOS 14, tvOS 17, watchOS 10 | Use the one-parameter overload on earlier targets |
For OS 27 APIs, check the selected SDK and provide an availability gate and fallback when the app supports older systems.
@State for view-owned value state.@Observable reference, store it in @State so SwiftUI owns its lifetime.@Bindable locally when the view needs bindings.@Environment for dependencies intentionally shared through a subtree.@MainActor unless their isolation is deliberately designed otherwise.import Observation
import SwiftUI
@MainActor
@Observable
final class ProfileModel {
var displayName = ""
}
struct ProfileEditor: View {
@State private var model = ProfileModel()
var body: some View {
@Bindable var model = model
TextField("Display name", text: $model.displayName)
}
}
For iOS 16 and earlier, use ObservableObject with @StateObject for view ownership and @ObservedObject for injection. That is a compatibility decision, not an anti-pattern.
ViewThatFits, and size classes. Use GeometryReader only when the child genuinely needs the proposed size.Hashable route data when navigation is state-driven.NavigationStack at its supported minimum. Use NavigationSplitView for genuinely multi-column interfaces, with a compact fallback..primaryAction, .confirmationAction, and .cancellationAction where they express intent across platforms.See the complete toolbar example and prompt scenarios.
Button, Toggle, TextField, Label, and other semantic controls..body, .headline) or @ScaledMetric; do not claim that a fixed .system(size:) font scales.List already creates rows lazily. Use ScrollView plus LazyVStack for layout/interaction behavior that List cannot provide, not as a blanket speed upgrade.body inexpensive, but do not promise that extracting a view creates an independent render boundary..equatable() or EquatableView only after measurement and only when equality fully represents visible output..task(id:) is usually the clearest view-lifetime tool.When a requested example spans architecture, accessibility, performance, or platform-specific behavior, keep this skill focused on the SwiftUI layer and route the other concerns to their dedicated guidance.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub fal3/swift-apple-skills --plugin ios-swift-skills14 skills in this plugin
/app-intents-widgetsDesign, implement, debug, and verify stable App Intents and WidgetKit integrations, including AppIntent, AppEntity, AppEnum, entity queries, AppShortcutsProvider, dependency injection, shared extension data, widget timelines, relevance, controls, Live Activity selection, deep links, handoff, confirmation, and privacy. Use when exposing app actions to Siri or Shortcuts, building configurable or interactive widgets, sharing state with extensions, or choosing the correct system surface for an action. Do not use for ordinary in-app buttons, generic SwiftUI layout, background scheduling without a widget or intent, SiriKit-only legacy work with no migration request, or Live Activity push-server implementation as the sole task./apple-evaluationsBuild, review, and debug generative AI quality regression suites with Apple's Evaluations framework, including Evaluation, datasets, metrics, Swift Testing integration, calibrated model judges, and tool-call trajectories. Use when measuring an Apple-platform intelligence feature, comparing prompts or models, or diagnosing misleading evaluation results. Do not use for ordinary deterministic unit tests, UI automation, performance profiling alone, model training, or an unrelated vendor's evaluation framework./cross-platform-app-development-skillUse when one Swift/SwiftUI product intentionally targets two or more of iOS, iPadOS, Mac Catalyst, macOS, watchOS, tvOS, or visionOS and needs shared-domain design, adaptive UI, capability boundaries, navigation, input, scenes, storage, or conditional compilation. Do not use for a single-platform feature or for non-Apple cross-platform frameworks./ios-accessibility-skillUse when iOS or iPadOS accessibility design, implementation, review, or testing involves VoiceOver, Voice Control, Switch Control, Full Keyboard Access, Dynamic Type, contrast, motion, focus, media alternatives, or Assistive Access. Do not use for generic visual styling or platform-neutral UI work with no accessibility requirement./ios-animation-graphics-skillDesign, implement, debug, and review accessible Apple-platform animation and graphics with SwiftUI animation, Canvas, TimelineView, matched geometry, phase/keyframe animators, Core Animation, and Lottie. Use for motion design, custom drawing, transitions, particles, animated symbols, UIKit/AppKit bridging, Reduce Motion, and animation performance. Prefer native SwiftUI for app UI; use Core Animation or Lottie only when their capabilities are needed. Do not use this skill for SpriteKit/Metal game engines, video rendering, or image editing unless animation integration is the specific task./iphone-duo-designUse when designing, adapting, implementing, or auditing an iOS app for iPhone Duo, including resizing, folding, vertical bars, reserved regions, state continuity, multiple scenes, camera behavior, and accessibility. Produce evidence-based readiness findings with SDK gates and fallbacks. Do not use for generic iPhone work without Duo or adaptive-layout requirements, Android foldables, Microsoft Surface Duo, Google Duo, or claims of Apple certification.Other plugins' skills for the same job