appkit-swiftui-bridge

Bridge AppKit and SwiftUI with NSViewRepresentable and NSHostingView.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/ano4l/SiteRent --skill appkit-swiftui-bridge-ano4l
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: appkit-swiftui-bridge
Source: https://github.com/ano4l/SiteRent/tree/main/skills/macos/appkit-swiftui-bridge
Command: npx skills add https://github.com/ano4l/SiteRent --skill appkit-swiftui-bridge-ano4l

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Embedding SwiftUI inside AppKit apps and exposing AppKit components to SwiftUI to enable incremental adoption and cross-framework collaboration.

Core Features & Use Cases

  • Wrapping NSView with NSViewRepresentable for SwiftUI compatibility.
  • Embedding SwiftUI content in AppKit containers via NSHostingView/NSHostingController.
  • Bridging state between frameworks with @Observable or Combine for synchronized UI.

Quick Start

Start by adding a small SwiftUI view and hosting it inside an AppKit container with NSHostingView to validate the bridge.

Frequently Asked Questions about appkit-swiftui-bridge

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

FAQPage Schema
How do I embed SwiftUI views inside an existing AppKit application?

To embed SwiftUI views inside an AppKit application, use NSHostingView or NSHostingController to host the SwiftUI content within your existing AppKit containers. This enables incremental adoption of SwiftUI without rewriting the entire app.

What is the best way to wrap an AppKit NSView for use in SwiftUI?

The best way to wrap an AppKit NSView for use in SwiftUI is to use NSViewRepresentable. This protocol allows you to bridge existing AppKit components into SwiftUI, enabling cross-framework collaboration and incremental adoption.

How do I bridge state between AppKit and SwiftUI?

You can bridge state between AppKit and SwiftUI using the @Observable macro or Combine. This ensures synchronized UI updates and cross-framework state sharing in hybrid macOS apps.

Can I adopt SwiftUI incrementally in a hybrid macOS app?

Yes, you can adopt SwiftUI incrementally in a hybrid macOS app by wrapping AppKit components with NSViewRepresentable and embedding SwiftUI content via NSHostingView, allowing both frameworks to coexist.

Why does my AppKit state not update my SwiftUI view?

AppKit state may not update SwiftUI views if state bridging is not properly configured. Use @Observable or Combine to establish synchronized UI updates and ensure cross-framework state sharing.

Does appkit-swiftui-bridge support cross-framework state sharing?

Yes, appkit-swiftui-bridge supports cross-framework state sharing. It bridges state between AppKit and SwiftUI using @Observable or Combine to maintain synchronized UI in hybrid macOS applications.