Open erksch opened 8 months ago
Ok, I got it :) Probably looks something like this:
class SeniorCareSpeechUIViewController: HostingParentController {
let hostingController = UIHostingController(rootView: MySwiftUIView)
override func viewDidLoad() {
super.viewDidLoad()
addChild(hostingController)
view.addSubview(hostingController.view)
hostingController.didMove(toParent: self)
}
}
Hey there!
The premise of this component sounds like what I am looking for (getting touches through a
UIHostingController
) but I do not understand how to useHostingParentController
. Where do I pass my SwiftUIView
?In the screenshot in the README you initialize some
UIHostingController
s but it is not clear where the variables are used. It would be helpful to have some more example code in the README :)