ARTICLE AD BOX
The modifier tipBackgroundInteraction(_:) can be used to allow interaction with the view behind the tip (available from iOS 26.0).
The documentation says:
On many platforms, SwiftUI automatically disables the view behind a popover tip that you present, so that people can’t interact with the backing view until they dismiss the tip. Use this modifier if you want to enable interaction.
Here is how it can be used to make the button receptive to taps in your example:
Button { print("Button tapped") tip.invalidate(reason: .actionPerformed) // Other important things to continue } label: { Text("Press this button to continue") } .popoverTip(tip) .tipBackgroundInteraction(.enabled) // 👈 hereAlthough this makes the button to receptive to taps and makes it possible to invalidate the tip as part of the button action, it also stops auto-dismiss from working when the user taps anywhere else on the screen. You said in a comment:
if the user taps somewhere else on the screen that's not the button, I'd like the tip to be dismissed (not invalidated) normally without triggering the button
To achieve this, you might want to add a masking layer behind the button, so that any tap that misses the tip and misses the button will go through to the background layer instead. An .onTapGesture on this layer can then be used as a catchall for these taps.
If you only want to hide the tip, instead of invalidating it, you can use popoverTip(_:isPresented:attachmentAnchor:arrowEdge:action:) to present it (also available from iOS 26.0). The binding supplied to isPresented can then be set to false in the tap action closure. Something like:
struct ExampleView: View { let tip = ExampleTip() @State private var isPresented = false var body: some View { ZStack { Color.clear .contentShape(.rect) .onTapGesture { isPresented = false } Button { print("Button tapped") tip.invalidate(reason: .actionPerformed) // Other important things to continue } label: { Text("Press this button to continue") } .popoverTip(tip, isPresented: $isPresented) .tipBackgroundInteraction(.enabled) } } }