Skip to content

Instantly share code, notes, and snippets.

@bocato
Created February 14, 2022 16:52
struct ToSwiftUIView<UIKitView: UIView>: UIViewRepresentable {
typealias UIViewType = UIKitView
let uikitView: () -> UIKitView
func makeUIView(context: Context) -> UIKitView {
uikitView()
}
func updateUIView(_ uiView: UIKitView, context: Context) {}
}
struct ToSwiftUIController: UIViewControllerRepresentable {
let viewController: () -> UIViewController
func makeUIViewController(context: Context) -> UIViewController {
self.viewController()
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment