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
View
contains 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, action: (() -> Void)? = nil)
Parameters
destination
The Destination that is disappearing.
navigationDestination
The Destination whose
View
contains aNavigationStack
.action
An optional action to perform when the button is tapped.
-
Declaration
Swift
@MainActor public func body(content: Content) -> some View