DestinationSwiftUICoordinator

@MainActor
public final class DestinationSwiftUICoordinator : NSObject, DestinationSwiftUICoordinating

This class coordinates the presentation of a Destination within the SwiftUI framework.

  • A reference to the root View in a SwiftUI app.

    Declaration

    Swift

    @MainActor
    public var rootView: (any View)?
  • A closure which is called when a Destination should be removed from the ecosystem, typically after it’s associated UI object is no longer being presented.

    Declaration

    Swift

    @MainActor
    public var removeDestinationClosure: RemoveDestinationFromFlowClosure?
  • The Destination that currently should be presented.

    Declaration

    Swift

    @MainActor
    public var destinationToPresent: (any Destinationable)?
  • A delegate protocol object which can subscribe to this object to receive updates about the status of destination presentations.

    Declaration

    Swift

    @MainActor
    public weak var delegate: DestinationInterfaceCoordinatorDelegate?
  • The initializer.

    Declaration

    Swift

    @MainActor
    public init(rootView: (any View)? = nil)

    Parameters

    rootView

    A reference to the root View in a SwiftUI app.

  • Handles the presentation of a Destination’s associated View in a SwiftUI app.

    Declaration

    Swift

    @MainActor
    public func presentViewDestination<PresentationConfiguration: DestinationPresentationConfiguring>(
        destination: (any ViewDestinationable<PresentationConfiguration>)? = nil,
        currentDestination: (any ViewDestinationable<PresentationConfiguration>)?,
        parentOfCurrentDestination: (any ViewDestinationable)?,
        configuration: PresentationConfiguration)

    Parameters

    destination

    The Destination to present.

    currentDestination

    The currently presented Destination.

    parentOfCurrentDestination

    The parent of the current Destination.

    configuration

    The configuration object for this presentation.