Trouble with UIResponder touchesBegan not firing on iOS 16 when using SwiftUI
I'm deploying to production and I'm upgrading from an older version and After trying multiple solutions online, I still can't figure this out... I'm refactoring my project and I'm facing an issue where the `touchesBegan` method in my `UIView` subclass isn't being called when I use this view within a SwiftUI context on iOS 16. I've tried several approaches to integrate the UIKit view with SwiftUI, and it seems like it's just not registering touches. Here's how I've set it up: ```swift import SwiftUI struct TouchView: UIViewRepresentable { func makeUIView(context: Context) -> TouchResponderView { return TouchResponderView() } func updateUIView(_ uiView: TouchResponderView, context: Context) {} } class TouchResponderView: UIView { override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesBegan(touches, with: event) print("Touches began!") // This is not printing on iOS 16 } } struct ContentView: View { var body: some View { TouchView() .frame(width: 300, height: 300) .border(Color.black) } } ``` I confirmed that the `TouchView` is being rendered, and I've played around with the frame size. However, when I tap on the view, there's no output from the `touchesBegan` method. I also tried to override `hitTest(_:with:)` in `TouchResponderView`, but it appears that the touch events are not reaching my view at all. Additionally, I tested this in both the simulator and on real devices running iOS 16. I suspect it might be related to how SwiftUI manages touch events, but I haven't found any clear documentation on this. Any insights on how to get `touchesBegan` to fire correctly in this setup would be greatly appreciated! My development environment is macOS. My team is using Swift for this mobile app. Any examples would be super helpful. Is this even possible? This is happening in both development and production on Ubuntu 20.04. Am I missing something obvious? I'm working on a application that needs to handle this. Any feedback is welcome! I'm working with Swift in a Docker container on Linux.