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
Complete working recipes for common UIKit wrapping scenarios. Each recipe includes the full UIViewRepresentable or UIViewControllerRepresentable struct, the Coordinator with delegate methods, a SwiftUI usage example, and gotchas specific to that wrapper.
Native WebKit for SwiftUI now covers modern embedded web content on iOS 26+. See the
swiftui-webkitskill forWebView,WebPage, navigation policies, JavaScript calls, and migration guidance. Keep this file focused on generic representable patterns.
Display a map with annotations, track region changes, and toggle map type.
import SwiftUI
import MapKit
struct MapViewRepresentable: UIViewRepresentable {
@Binding var region: MKCoordinateRegion
@Binding var mapType: MKMapType
var annotations: [MKPointAnnotation]
var onRegionChanged: ((MKCoordinateRegion) -> Void)?
func makeCoordinator() -> Coordinator { Coordinator(self) }
func makeUIView(context: Context) -> MKMapView {
let mapView = MKMapView()
mapView.delegate = context.coordinator
mapView.showsUserLocation = true
Next to this one in the catalogue, plus more from the same author.