Hello everyone, I'm trying to integrate a SwiftUI TextField component into a UIViewController. But any kind of tutorial I've seen, have this implementation:
let childView = UIHostingController(rootView: SwiftUIView())
addChild(childView)
childView.view.frame = frame
view.addSubview(childView.view)
childView.didMove(toParent: self)
But, when I do this, my Navigation Bar disappear. But when I remove the "addChild" peace of code, everything works well. Is this a wrong thing to do? Can I remove this part of code?
3
0
1.5k