In SwiftUI, how do you detect a tap on a full screen custom view behind a full screen TabView?

Here's a side view of the views:

a b

| | c

| | |

| |

View a is the full screen custom view underneath the other views

View b is the full screen TabView

View c is a smaller custom view shown via the first tab

I'm using the trick linked below to make the TabView background transparent so you can see the full screen custom view behind it:

https://stackoverflow.com/questions/63178381/make-tabview-background-transparent

https://stackoverflow.com/a/63179684

As mentioned earlier, in the first tab there is a smaller custom view (shown as view c above). You can interact with it by tapping.

However, if you tap outside this smaller custom view, the tap should go to the full screen custom view underneath the TabView.

How do I accomplish this?

BTW, both custom views are UIViewRepresentable views in case that matters.

Post not yet marked as solved Up vote post of DropZap Down vote post of DropZap
424 views

Replies

You do not show code, so hard to say.

One point to check: have you defined a .frame for the subviews ?