DestinationPathNavigating

@MainActor
public protocol DestinationPathNavigating : AnyObject

This protocol represents a Destination navigator path object. It should be implemented to allow for system-level navigation stacks like SwiftUI’s NavigationStack into the Destinations ecosystem, which the DestinationNavigator class implements.

  • An array of UUID identifiers representing Destinations in the associated navigation path.

    Declaration

    Swift

    @MainActor
    var navigationPath: [UUID] { get set }
  • The identifier of the current destination presentation.

    Declaration

    Swift

    @MainActor
    var currentPresentationID: UUID? { get set }
  • The identifier of the Destination associated with this navigator.

    Declaration

    Swift

    @MainActor
    var navigatorDestinationID: UUID? { get set }
  • addPathElement(item:shouldAnimate:) Default implementation

    Adds a Destination to the path.

    Default Implementation

    Declaration

    Swift

    @MainActor
    func addPathElement(item: UUID, shouldAnimate: Bool?)

    Parameters

    item

    A Destination identifier to be added to the path.

    shouldAnimate

    Determines whether this path element should be animated when presented.

  • currentPathElement() Default implementation

    Returns the current path element. Typically this would be the identifier associated with a Destinationable object.

    Default Implementation

    Declaration

    Swift

    @MainActor
    func currentPathElement() -> UUID?

    Return Value

    A UUID identifier of the associated element.

  • Removes the current navigation element and makes the previous element in the path the current element.

    Default Implementation

    Declaration

    Swift

    @MainActor
    func backToPreviousPathElement(previousPresentationID: UUID?)

    Parameters

    previousPresentationID

    An optional unique identifier of the previous destination.

  • previousPathElement() Default implementation

    Returns the previous path element.

    Default Implementation

    Declaration

    Swift

    @MainActor
    func previousPathElement() -> UUID?

    Return Value

    A UUID identifier of the previous path element.

  • removeAll() Default implementation

    Removes all path elements from the navigation path.

    Default Implementation

    Declaration

    Swift

    @MainActor
    func removeAll()