focus-engine

Manage keyboard, directional, and scene-level focus behavior in SwiftUI and UIKit apps.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/onymchat/onym-ios --skill focus-engine
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: focus-engine
Source: https://github.com/onymchat/onym-ios/tree/main/.claude/skills/focus-engine
Command: npx skills add https://github.com/onymchat/onym-ios --skill focus-engine

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Focus management across multiple UI frameworks and devices is complex and error-prone; this skill centralizes keyboard, directional, and scene-level focus behavior across SwiftUI and UIKit to provide deterministic navigation and accessibility.

Core Features & Use Cases

  • Centralizes management of @FocusState, defaultFocus, focused values, and focus sections across macOS, iOS, iPadOS, tvOS, watchOS, and visionOS.
  • Provides guidance for UIKit focus guides, tvOS geometry-based focus, and restoration of focus after transient UI, enabling consistent and accessible navigation in apps.
  • Use cases include building accessible forms with predictable focus movement, multi-scene focus coordination, and debugging focus with UIFocusDebugger.

Quick Start

Open the Focus Engine skill in your project and follow the setup steps to integrate the focus patterns across your UI components.

Frequently Asked Questions about focus-engine

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage focus behavior consistently across SwiftUI and UIKit?

Unified focus behavior across SwiftUI and UIKit is achieved by centralizing @FocusState, defaultFocus, and focus sections, providing deterministic keyboard and directional navigation across your app components.

Does cross-platform focus management support tvOS and visionOS?

Cross-platform focus management supports tvOS and visionOS, alongside iOS, iPadOS, macOS, and watchOS, applying platform-specific nuances like tvOS geometry-based focus and scene-level coordination for accessible input models.

What is the best way to restore focus after transient UI appears in SwiftUI?

Restoring focus after transient UI appears requires managing scene-level focus behavior using @FocusState and defaultFocus, returning input control to the previously active component deterministically.

How do I debug focus issues with UIFocusDebugger in my app?

Debugging focus issues is supported by utilizing UIFocusDebugger alongside centralized focus patterns, enabling you to inspect and resolve unpredictable directional navigation and focus restoration errors across your UI components.

How do I build accessible forms with predictable focus movement on iPadOS?

Accessible forms with predictable focus movement on iPadOS are built using focus sections and @FocusState, establishing safe defaults and deterministic keyboard navigation for complex input workflows.

Why does focus behavior break when navigating between multiple scenes in my app?

Focus behavior breaks during multi-scene navigation due to uncoordinated focus state, requiring centralized scene-level focus management and defaultFocus restoration to maintain deterministic accessibility across input models.