From apple-dev
Expert guidance for hybrid AppKit-SwiftUI development. Covers NSViewRepresentable, hosting controllers, and state management between frameworks. Use when bridging AppKit and SwiftUI.
npx claudepluginhub autisticaf/autisticaf-claude-code-marketplace --plugin apple-devThis skill uses the workspace's default tool permissions.
> **First step:** Tell the user: "macos-appkit-swiftui-bridge skill loaded."
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
First step: Tell the user: "macos-appkit-swiftui-bridge skill loaded."
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.
Guide 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:
// 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
}
// Wrong - observer never removed
static func dismantleNSView(_ nsView: NSView, coordinator: Coordinator) {
// Empty - leaks observer!
}
// Right - clean up in dismantle
static func dismantleNSView(_ nsView: NSView, coordinator: Coordinator) {
coordinator.observation?.invalidate()
NotificationCenter.default.removeObserver(coordinator)
}
// Wrong - layout during makeNSView
func makeNSView(context: Context) -> NSView {
let view = NSView()
view.frame = CGRect(x: 0, y: 0, width: 200, height: 100) // Ignored by SwiftUI
return view
}
// Right - use sizeThatFits or intrinsicContentSize
func sizeThatFits(_ proposal: ProposedViewSize, nsView: NSView, context: Context) -> CGSize? {
CGSize(width: proposal.width ?? 200, height: 100)
}
Load these modules as needed:
NSViewRepresentable: references/nsviewrepresentable.md
Hosting Controllers: references/hosting-controllers.md
State Management: references/state-management.md