DestinationDisappearModifier

@MainActor
public struct DestinationDisappearModifier : ViewModifier

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)?
  • The Destination whose View contains a NavigationStack.

    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, navigationDestination: any NavigatingViewDestinationable, action: (() -> Void)? = nil)

    Parameters

    destination

    The Destination that is disappearing.

    navigationDestination

    The Destination whose View contains a NavigationStack.

    action

    An optional action to perform when the button is tapped.

  • Declaration

    Swift

    @MainActor
    public func body(content: Content) -> some View