swiftui-uikit-interop — Claude Code skill: setup and overview
Bridges UIKit and SwiftUI views, controllers, and shared state without lifecycle conflicts or duplicated data.
npx skills add dpearson2699/swift-ios-skills --skill swiftui-uikit-interop -a claude-codeWhat swiftui-uikit-interop does
The skill equips coding agents with integration patterns between UIKit and SwiftUI. It covers UIViewRepresentable and UIViewControllerRepresentable implementations, explicit handling of updateUIView cycles, and teardown logic inside dismantleUIView. Custom sizing with sizeThatFits is also covered for iOS 16 and later.
The coordinator pattern receives focused attention because value-type SwiftUI structs cannot act as UIKit delegates directly. Storing references on a dedicated coordinator class lets delegate callbacks safely mutate parent @Binding properties. Without defensive checks in view updates, two-way state synchronization easily triggers infinite rendering loops.
What it helps with
- wrap UIKit views in SwiftUI structs safely
- present system view controllers using UIViewControllerRepresentable
- route delegate callbacks back to SwiftUI bindings with a coordinator
- configure custom view dimensions with sizeThatFits on iOS 16+
Example prompts for the agent
- Wrap UITextView in a UIViewRepresentable with a two-way text binding.
- Show how to present VNDocumentCameraViewController inside a SwiftUI sheet using a coordinator.
- Add dismantleUIView to clean up active observers and subscriptions when the view leaves the hierarchy.
How to install swiftui-uikit-interop
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-uikit-interop -a claude-code2Manually: put the files in place
~/.claude/skills/swiftui-uikit-interop/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/swiftui-uikit-interop/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-uikit-interop -a codex2Manually: put the files in place
.agents/skills/swiftui-uikit-interop/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-uikit-interop -a cursor2Manually: put the files in place
.cursor/skills/swiftui-uikit-interop/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dpearson2699/swift-ios-skills swiftui-uikit-interop2Manually: put the files in place
.github/skills/swiftui-uikit-interop/SKILL.md1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-uikit-interop -a gemini-cli2Platform CLI
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swiftui-uikit-interopManually: put the files in place
.devin/skills/swiftui-uikit-interop/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-uikit-interop -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about swiftui-uikit-interop
How do I install swiftui-uikit-interop in Claude Code?
Run npx skills add dpearson2699/swift-ios-skills --skill swiftui-uikit-interop -a claude-code in your terminal.
What does swiftui-uikit-interop do?
It provides architecture rules and lifecycle templates for embedding UIKit views into SwiftUI and synchronizing state between both frameworks.
Why is a coordinator needed for UIKit delegates?
SwiftUI view representations are value-type structs, whereas UIKit delegates require reference types. The coordinator holds the class instance that receives delegate callbacks and updates parent bindings.