SheetPresenting
@MainActor
public protocol SheetPresenting : StateModeling where Self.Destination : ViewDestinationable
This protocol represents a StateModeling-conforming object attached to a View that supports presenting a SwiftUI sheet via its SheetPresenter object.
To present a sheet using Destinations, simply have the View‘s state model adopt this protocol, add the built-in ViewModifier .destinationSheet(stateModel.sheetPresentation)) to the View, 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 that is used by Destinations internally to trigger the system sheet dismissal.
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