What problem does it solve?
It solves the integration problem of reusing UIKit views and view controllers inside a SwiftUI app (and vice versa) without breaking state updates, layout, or delegate callbacks.
Core Features & Use Cases
- Wrap UIKit views in SwiftUI: Use
UIViewRepresentable to embed UIKit UIView subclasses while keeping SwiftUI state and UIKit behavior synchronized.
- Wrap UIKit controllers in SwiftUI: Use
UIViewControllerRepresentable to present and coordinate UIKit-only flows (pickers, scanners, mail, shares, PDF/document viewers).
- Coordinate delegate callbacks safely: Use the Coordinator pattern to bridge delegate/data-source events back into SwiftUI via
@Binding and closures, while avoiding update loops and retain cycles.
- Host SwiftUI inside UIKit: Use
UIHostingController (and UIHostingConfiguration for iOS 16+) to embed SwiftUI content into UIKit containers and cells with correct sizing.
- Manage state, layout, and environment across the boundary: Apply sizing options, prevent redundant updates, and bridge environment/trait behavior reliably.
Quick Start
Use the swiftui-uikit-interop skill to wrap a UITextView for attributed text editing with UIViewRepresentable, coordinating delegate-driven edits back to a SwiftUI @Binding for smooth two-way sync.