Contents

presentationPlacement(_:)

Sets the placement of a presentation within the presenting view.

Declaration

nonisolated func presentationPlacement(_ placement: PresentationPlacement) -> some View

Parameters

  • placement:

    The placement of the presentation within the presenting view.

Discussion

By default, a presentation uses automatic placement. Use this modifier to place it on the leading or trailing edge. For example, to maximize the visibility of the primary content behind a presented sheet:

Map()
    .sheet(isPresented: $isPresented) {
        PlaceDetailView()
            .presentationDetents([.medium, .large])
            .presentationPlacement(.leading)
    }

Only sheet presentations respect this placement.

See Also

Configuring a sheet’s height and placement