Implements and debugs keyboard, directional, and scene-level focus across SwiftUI and UIKit. Covers FocusState, focus restoration, tvOS remote navigation, watchOS crown focus, visionOS input, macOS key loops, and UIFocusGuide.
Ships in all-ios-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.
Focus behavior for SwiftUI and UIKit apps targeting iOS 26+, iPadOS, macOS, tvOS, and visionOS connected-input paths. Covers keyboard focus, directional focus, scene-focused values, focus restoration, and UIKit focus guides. focusSection() guidance in this skill applies to macOS and tvOS. visionOS gaze-driven hover is an input affordance, not focus. Accessibility-specific focus for VoiceOver and Switch Control lives in the ios-accessibility skill.
When a request mixes focus with accessibility or spatial input, keep the boundary explicit:
ios-accessibility.Use @FocusState to read and write focus placement inside a scene. Use Bool for a single target or an optional Hashable enum for multiple targets. Keep focus state local to the view that owns the focusable controls.
@FocusState private var focusedField: Field?
TextField("Email", text: $email).focused($focusedField, equals: .email)
.onSubmit { focusedField = .password }
See FocusState patterns for the full multi-field form example.
Use .defaultFocus to set the preferred initial focus region or control when a view appears or when focus is reassigned automatically. Prefer one clear default destination per screen or focus region.
Use focused values to expose state from the currently focused view. Use scene-focused values (focusedSceneValue) when commands or scene-wide UI should keep access to the value even after focus moves within that scene. Use this pattern for menus, commands, and toolbars that need to act on the focused scene's current content.
Use .focusable(_:interactions:) on custom SwiftUI views that should participate in keyboard or directional focus. Prefer semantic Button, Toggle, TextField, and other system controls before making arbitrary gesture-driven views focusable; use .focusable(interactions: .activate) for custom button-like controls only when a semantic control cannot express the UI.
Use focusSection() on macOS 13+ and tvOS 15+ to guide directional movement across groups of focusable descendants in uneven layouts. Use it when default left/right or up/down movement skips the intended group.
After dismissing a sheet, popover, or transient overlay, return focus to a stable trigger or logical next target. Restore focus intentionally whenever presentation changes would otherwise leave users disoriented.
Use UIFocusGuide when UIKit or tvOS layouts need custom routing across empty space or awkward geometry. UIFocusGuide is invisible and not a view; constrain it like a layout guide and set preferredFocusEnvironments. Use it to redirect focus without adding decorative UI.
See Focus patterns for complete SwiftUI and UIKit examples.
@FocusState in shared models instead of the owning view..focusable() on decorative views.UIFocusGuide before trying focusSection() on macOS or tvOS, or better layout grouping in SwiftUI.Button when possible.@FocusState is local to the view that owns the controlsfocusedSceneValue or related focused-value APIs are used when commands need current scene statefocusSection() is used for uneven directional layouts on macOS or tvOS before dropping to UIKitUIFocusGuide geometry and preferred destinations match the intended routeios-accessibility, not mixed into keyboard-directional focus logicWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/all-ios-skills:focus-enginefrom all-ios-skills
npx claudepluginhub thienqo/ios-skills --plugin all-ios-skills95 skills in this plugin
/accessorysetupkitDiscover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery descriptors for BLE or Wi-Fi devices, handling accessory session events, migrating from CoreBluetooth permission-based scanning, or setting up accessories without requiring broad Bluetooth permissions./activitykitBuild or review Live Activities and Dynamic Island experiences with ActivityKit, including lifecycle, layouts, push updates, and scheduled delivery. Use for time-sensitive Lock Screen or Dynamic Island state; route ordinary widgets to widgetkit./adattributionkitMeasure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks, updating conversion values, implementing re-engagement attribution, configuring publisher or advertiser apps, or replacing SKAdNetwork with AdAttributionKit for ad measurement.Other plugins' skills for the same job