I am working on an app that has both swiftUI and storyboard. I have a button in swift UI. On click of this I need to navigate to a storyboard screen. I tried the below code but it is not getting called. Kindly help....
in my swiftUI, the button code is as below,
Button(action:{ TestController()
}, label:
{
Text("Click me").foregroundColor(.white)
Image(systemName: "chevron.forward.2").imageScale(.large)})
struct TestController: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> some UIViewController {
let storyboard = UIStoryboard(name: "test", bundle: Bundle.main)
let controller = storyboard.instantiateViewController(identifier: "testView")
return controller
}
func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) {
}
}
Please help me...