swiftui-uikit-interop

Wrap UIKit views and view controllers with SwiftUI representations.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/harshav167/build-ios-apps --skill swiftui-uikit-interop-harshav167
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-uikit-interop
Source: https://github.com/harshav167/build-ios-apps/tree/main/skills/swiftui-uikit-interop
Command: npx skills add https://github.com/harshav167/build-ios-apps --skill swiftui-uikit-interop-harshav167

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Bridges UIKit and SwiftUI by wrapping UIKit views and view controllers in SwiftUI representations, enabling seamless interoperability between the two UI frameworks and easing incremental migrations.

Core Features & Use Cases

  • Wrappers for UIKit controls via UIViewRepresentable and UIViewControllerRepresentable.
  • UIHostingController-based embedding to mix SwiftUI within UIKit and UIKit within SwiftUI.
  • Coordinators to handle delegation, data binding, and lifecycle events.
  • Migration patterns and references to facilitate gradual adoption in existing apps.

Quick Start

Wrap a UIKit view with UIViewRepresentable and wire it to SwiftUI state using a Coordinator.

Frequently Asked Questions about swiftui-uikit-interop

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

FAQPage Schema
How do I wrap a UIKit view in SwiftUI?

Yes, you can embed SwiftUI views inside UIKit using UIHostingController. This allows seamless interoperability for mixing SwiftUI within existing UIKit apps or hosting UIKit components like camera previews within SwiftUI.

What is the best way to migrate a UIKit app to SwiftUI incrementally?

Use a Coordinator when wrapping UIKit components in SwiftUI to handle delegation, data binding, and lifecycle events. It acts as the bridge for communication between the UIKit view and the SwiftUI representation.

Can I integrate UIKit components like camera previews and document scanners into SwiftUI?

Yes, you can integrate UIKit components such as camera previews, maps, mail composition, document scanners, and PDF renderers into SwiftUI. This is achieved by wrapping them with UIViewControllerRepresentable and managing their lifecycle via a Coordinator.

Does UIViewRepresentable support delegation for UIKit controls in SwiftUI?

Yes, UIViewRepresentable supports delegation for UIKit controls through the implementation of a Coordinator. The Coordinator manages delegation, data binding, and lifecycle events to ensure seamless interop.