Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Bridges UIKit and SwiftUI with representables, UIHostingController, coordinators, and observation tracking for shared state.
73% 100%+27 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 16 of 22 without it.
I'm building an iOS app where I need to wrap a native UISearchBar inside SwiftUI so I can filter items live with two-way binding. Can you show me how to write a complete UIViewRepresentable wrapper with a coordinator for delegate callbacks, including proper state sync handling?
Annotates the Coordinator class with @MainActor.
3 of 3 safety checks passed
Patterns for incrementally migrating a UIKit app to SwiftUI. Each pattern is self-contained with rationale, implementation, and gotchas.
Replace one UIViewController at a time with a UIHostingController wrapping a SwiftUI view. This is the safest migration path -- each screen is an isolated unit.
UIHostingController wherever it was instantiated.// BEFORE: UIKit screen pushed onto a navigation stack
let detailVC = ItemDetailViewController(item: item)
navigationController?.pushViewController(detailVC, animated: true)
// AFTER: SwiftUI screen wrapped in UIHostingController
let detailView = ItemDetailView(item: item)
let hostingVC = UIHostingController(rootView: detailView)
navigationController?.pushViewController(hostingVC, animated: true)
Next to this one in the catalogue, plus more from the same author.