Use this skill when SwiftUI is close but not quite enough for native macOS behavior.
Keep the bridge as small and explicit as possible. SwiftUI should usually remain
the source of truth, while AppKit handles the imperative edge.
-
Name the capability gap precisely.
- Window behavior
- Text system behavior
- Menu validation
- Drag and drop
- File open/save panels
- First responder control
-
Pick the smallest boundary that solves it.
- Avoid porting a whole screen to AppKit when one wrapped control or coordinator would do.
-
Keep ownership explicit.
- SwiftUI owns value state, selection, and observable models.
- AppKit objects stay inside the representable, coordinator, or bridge object.
-
Expose a narrow interface back to SwiftUI.
- Bindings for editable state
- Small callbacks for events
- Focused bridge services only when necessary
-
Validate lifecycle assumptions.
- SwiftUI may recreate representables.
- Coordinators exist to hold delegate and target-action glue, not as a second app architecture.