DestinationDisappearModifier
@MainActor
public struct DestinationDisappearModifier<DestinationType, ContentType, TabType> : ViewModifier where DestinationType : RoutableDestinations, ContentType : ContentTypeable, TabType : TabTypeable
A ViewModifier that handles the removal of a Destination from the Destinations ecosystem when its associated View disappears from a NavigationStack.
-
The Destination that is disappearing.
Declaration
Swift
@MainActor public weak var destination: (any ViewDestinationable<DestinationType, ContentType, TabType>)? -
The Destination whose
Viewcontains aNavigationStack.Declaration
Swift
@MainActor public weak var navigationDestination: (any NavigatingViewDestinationable)? -
The presentation identifier of the system action moving back in the
NavigationStack.Declaration
Swift
@MainActor public var presentationID: UUID? -
An optional action to perform when the button is tapped.
Declaration
Swift
@MainActor public var disappearanceAction: (() -> Void)? -
The initializer.
Declaration
Swift
@MainActor public init(destination: any ViewDestinationable<DestinationType, ContentType, TabType>, navigationDestination: (any NavigatingViewDestinationable)? = nil, action: (() -> Void)? = nil)Parameters
destinationThe Destination that is disappearing.
navigationDestinationThe Destination whose
Viewcontains aNavigationStack.actionAn optional action to perform when the button is tapped.
-
Declaration
Swift
@MainActor public func body(content: Content) -> some View
View on GitHub