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
SheetPresenterobject which handles the presentation of sheets.Declaration
Swift
@MainActor var sheetPresentation: SheetPresentation { get set } -
presentSheet(sheet:Default implementation) -
dismissSheet()Default implementationDismisses 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 : ViewDestinationableParameters
destinationThe Destination presenting this sheet.
Return Value
The
SheetDismissalClosureclosure.
View on GitHub