swiftui-focus-management

Community

Precise SwiftUI focus & keyboard control

AuthorAutisticAF
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Managing which view has focus, controlling keyboard visibility and return-key behavior, and navigating text inputs in SwiftUI can be error-prone and platform-specific; this skill provides clear patterns to implement reliable, accessible focus and keyboard flows across Apple platforms.

Core Features & Use Cases

  • Single-field focus toggling using a Bool-backed @FocusState for quick auto-focus and dismissal.
  • Multi-field form navigation with Hashable enum @FocusState, submitLabel and onSubmit chaining, and keyboard toolbar Next/Previous/Done controls.
  • Advanced patterns including FocusedValue/FocusedBinding for macOS menu commands, making non-text views focusable, focus sections for tvOS, and setting default focus on appear.
  • Practical use cases: login or signup forms that move between fields, rich text editors with keyboard toolbars, macOS apps exposing focused content to menu commands, and tvOS spatial focus grouping.

Quick Start

Ask the assistant to implement enum-based @FocusState navigation with submitLabel chaining and a keyboard toolbar that provides Next, Previous, and Done actions.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: swiftui-focus-management
Download link: https://github.com/AutisticAF/claude-code-apple-dev-plugin/archive/main.zip#swiftui-focus-management

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.