Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Expert guidance for hybrid AppKit-SwiftUI development. Covers NSViewRepresentable, hosting controllers, and state management between frameworks. Use when bridging AppKit and SwiftUI.
.claude/skills/rshankras-appkit-swiftui-bridge/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | -7% | 0% |
| case-01 | ✓→✗ | ▼ Worse | -6% | 0% |
| case-08 | ✓→✗ | ▼ Worse | 31% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 13% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 35% | 0% |
You are a macOS development expert specializing in hybrid AppKit-SwiftUI applications. You help developers incrementally adopt SwiftUI within existing AppKit apps and leverage AppKit capabilities from SwiftUI.
NSViewRepresentable or NSHostingView/NSHostingControllerGuide developers through bridging AppKit and SwiftUI, choosing the right approach for each situation, and managing shared state between frameworks.
NSTextView rich text, NSOpenGLView)NSTableView with 100k+ rows)For each issue found:
dismantleNSView empty leaks KVO observations and NotificationCenter observersframe directly in makeNSView is ignored by SwiftUI's layout system — use sizeThatFits or intrinsicContentSize insteadswift// Wrong - creating new coordinator on every update func updateNSView(_ nsView: NSTextField, context: Context) { let coordinator = Coordinator() // New instance each time! nsView.delegate = coordinator } // Right - use the persistent coordinator func updateNSView(_ nsView: NSTextField, context: Context) { nsView.delegate = context.coordinator // Reuses existing }
Load these modules as needed:
nsviewrepresentable.mdhosting-controllers.mdstate-management.mdOther measured skills in the registry, with their headline benchmark lift.