appkit-swiftui-bridge

Guides hybrid AppKit-SwiftUI development using NSViewRepresentable and hosting controllers.

Updated May 11, 2026
One-click install
npx skills add https://github.com/cloudofgeorge/AI-hands-Engineer --skill appkit-swiftui-bridge-cloudofgeorge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: appkit-swiftui-bridge
Source: https://github.com/cloudofgeorge/AI-hands-Engineer/tree/main/skills/engineering/domains/macos/macos-development/appkit-swiftui-bridge
Command: npx skills add https://github.com/cloudofgeorge/AI-hands-Engineer --skill appkit-swiftui-bridge-cloudofgeorge

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building macOS apps often requires mixing AppKit and SwiftUI, and developers struggle with wrapping AppKit views, embedding SwiftUI content, and keeping state synchronized across both frameworks. ## Core Features & Use Cases - NSViewRepresentable Guidance: Wrap AppKit views such as NSTextField, NSTableView, and custom views for use inside SwiftUI hierarchies. - Hosting Controllers: Embed SwiftUI content in AppKit apps using NSHostingView and NSHostingController. - State Bridging: Synchronize state between frameworks using Combine and @Observable. - Use Case: You are modernizing a legacy AppKit app screen by screen and need to embed a new SwiftUI settings panel while keeping the existing NSTableView-driven main window fully functional. ## Quick Start Ask for guidance on wrapping an AppKit NSTableView in SwiftUI and bridging its selection state with Combine.

Frequently Asked Questions about appkit-swiftui-bridge

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

FAQPage Schema
How do I wrap an AppKit view for use in SwiftUI?

Use NSViewRepresentable to wrap AppKit views such as NSTextField, NSTableView, or custom views so they can be embedded in SwiftUI view hierarchies. The protocol handles view creation and updates between the frameworks.

How do I embed SwiftUI views inside an AppKit app?

Use NSHostingView or NSHostingController to host SwiftUI content within AppKit windows and view hierarchies. NSHostingController works well for view-controller-based structures, while NSHostingView fits direct view embedding.

How do I share state between AppKit and SwiftUI?

Bridge state using Combine publishers or the @Observable macro so changes propagate between AppKit and SwiftUI layers. A shared observable model object keeps both frameworks synchronized.

When should I use NSHostingView vs NSHostingController?

Use NSHostingView when embedding SwiftUI directly into an existing AppKit view hierarchy, and NSHostingController when you need view controller lifecycle integration such as in window or split view controllers.

What are the limitations of mixing AppKit and SwiftUI?

Bridging adds complexity around state synchronization, responder chain behavior, and lifecycle mismatches between the frameworks. It is best suited for incremental migration rather than deeply interleaved view trees.