← Files Build macOS AppsARCHIVED FILE

skills/appkit-interop/references/responder-menus.md

834 Bytes · Oct 4, 2026 · 12:37 UTC

↓ Download file

# Responder Chain and Menus

## Intent

Use this when command handling depends on the active window, first responder, or AppKit menu validation.

## Core patterns

- Start with SwiftUI `commands`, `FocusedValue`, and focused scene state.
- Use AppKit responder-chain hooks only when command routing or validation truly depends on the underlying responder system.
- Keep menu enablement rules close to the state they depend on.

## Good fits for AppKit

- Validating whether a menu item should be enabled
- Routing actions through the current first responder
- Integrating with existing AppKit document or text behaviors

## Pitfalls

- Do not recreate AppKit-style global command handling when SwiftUI focused values would work.
- Avoid scattering command logic between SwiftUI closures and AppKit selectors without a clear boundary.

SHA-256: df1a3a1baf83566c5984a16ce61ac9d78ffafcda4d7636e27cfc8e5b19a5bd8b