View

public extension View
  • Adds a replacement button for Views being presented in a NavigationStack.

    Declaration

    Swift

    @MainActor
    public func goBackButton(buttonImage: Image? = nil, selectionAction: (() -> Void)?) -> some View

    Parameters

    buttonImage

    The button image to show for the back button.

    selectionAction

    An optional action to perform when the back button is tapped.

    Return Value

    The View which provides the navigation bar customization.

  • Handles the removal of a Destination from the Destinations ecosystem when its associated View disappears.

    Declaration

    Swift

    @MainActor
    public func onDestinationDisappear(destination: any ViewDestinationable, navigationDestination: any NavigatingViewDestinationable, action: (() -> Void)? = nil) -> some View

    Parameters

    destination

    A Destination whose disappearance should be tracked.

    navigationDestination

    A Destination whose View contains a NavigationStack.

    action

    An optional action to perform when the View disappears.

    Return Value

    A View which runs the removal logic and optional action when it disappears.

  • Provides a ViewModifier which can present a Destination as a sheet.

    Declaration

    Swift

    @MainActor
    public func destinationSheet(presentation: SheetPresentation) -> some View

    Parameters

    presentation

    The configuration object for a sheet presentation.

    Return Value

    The View which provides the sheet presentation.