Forwarding touches from SwiftUI View with transparent background to UIKit view
Asked Answered
S

0

7

I have a large SwiftUI view that contains a bottom menu and some small UI components above it. I want to overlay this view on top of an existing UIViewController instance and therefore using a UIHostingController.

The problem I'm having is that, the transparent regions of my SwiftUI view do not forward the touches despite the background of both the SwiftUI view and the view of the UIHostingController being transparent.

Since I can't replace the view subclass used by the UIHostingController, I can't mess with its hit testing mechanism to make it forward the touches manually.

Is there a way to accomplish this? It seems to be impossible right now.

Spinnaker answered 30/8, 2022 at 17:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.