Contents

tipBackgroundInteraction(_:)

Controls whether people can interact with the view behind a presented tip.

Declaration

nonisolated func tipBackgroundInteraction(_ interaction: PresentationBackgroundInteraction) -> some View

Parameters

  • interaction:

    A specification of how people can interact with the view behind a presented tip.

Discussion

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.

The following example enables people to interact with the view behind a popoverTip.

struct LandmarkDetail: View {
    let landmark: Landmark

    var body: some View {
        ScrollView {
            MapView(coordinate: landmark.locationCoordinate)
                .popoverTip(CampsiteTip())
                .tipBackgroundInteraction(.enabled)

            HStack {
                Text(landmark.name)
                Text(landmark.park)
            }
        }
    }
}