SheetPresenting

@MainActor
public protocol SheetPresenting : ViewDestinationInterfacing

This protocol represents a View that supports presenting a SwiftUI sheet via its SheetPresenter object.

To present a sheet using Destinations, simply have your View adopt this protocol, add a ViewModifier for the sheetPresenter (.modifier(sheetPresenter)), and present a Destination with a presentationType of .sheet(type: .present).

  • The SheetPresenter object which handles the presentation of sheets.

    Declaration

    Swift

    @MainActor
    var sheetPresentation: SheetPresentation { get set }
  • presentSheet(sheet:) Default implementation

    Presents a View in a sheet from the current interface.

    Default Implementation

    Declaration

    Swift

    @MainActor
    func presentSheet(sheet: any Sheetable)

    Parameters

    sheet

    A Sheetable model representing the View to present in a sheet.

  • dismissSheet() Default implementation

    Dismisses a sheet that’s currently presented.

    Default Implementation

    Declaration

    Swift

    @MainActor
    func dismissSheet()
  • sheetDismissalClosure(destination:) Default implementation

    Returns a closure designed to run when a sheet is dismissed.

    Default Implementation

    Declaration

    Swift

    @MainActor
    func sheetDismissalClosure<Destination>(destination: Destination) -> SheetDismissalClosure where Destination : ViewDestinationable

    Parameters

    destination

    The Destination presenting this sheet.

    Return Value

    The SheetDismissalClosure closure.