I have added a button in UIController:
let button = UIButton(type: .custom)
button.setTitle("test", for: .normal)
button.addTarget(self, action: #selector(addToSiri), for: .touchUpInside)
self.view.addSubview(button)
Then using it in SwiftUI
HStack {
Controller()
}.frame(maxWidth:.infinity, idealHeight: 60)
And then using swiftUI in UIHostingController:
let vc = UIHostingController(rootView: SwiftUIView())
But when I tap the button, the addToSiri
is never called.
I don't know why.