ViewFlow
@MainActor
public final class ViewFlow<DestinationType, TabType, ContentType> : ViewFlowable, ObservableObject where DestinationType : RoutableDestinations, TabType : TabTypeable, ContentType : ContentTypeable
extension ViewFlow: DestinationInterfaceCoordinatorDelegate
A concrete Flow class designed to be used to manage Destinations flows within the SwiftUI framework. In most cases creating a custom Flow object is unnecessary, and this class can be used as-is in your SwiftUI-based app.
-
A type of object that coordinates the presentation of a Destination within a UI framework.
Declaration
Swift
public typealias InterfaceCoordinator = DestinationSwiftUICoordinator -
Declaration
Swift
@MainActor public var activeDestinations: [any Destinationable<DestinationType, ContentType, TabType>] -
Declaration
Swift
@MainActor public var currentDestination: (any Destinationable<DestinationType, ContentType, TabType>)? -
Declaration
Swift
@MainActor public var destinationProviders: [DestinationType : any ViewDestinationProviding] -
Declaration
Swift
@MainActor public var uiCoordinator: DestinationSwiftUICoordinator? -
Declaration
Swift
@Published @MainActor public var rootDestination: (any Destinationable<DestinationType, ContentType, TabType>)? { get set } -
Declaration
Swift
@MainActor public var destinationQueue: [DestinationPresentation<DestinationType, ContentType, TabType>] -
Declaration
Swift
@MainActor public var isPresentingDestinationPath: Bool -
The starting Destination in the Flow.
Declaration
Swift
@MainActor public var startingDestination: DestinationPresentation<DestinationType, ContentType, TabType>? -
The initializer.
Declaration
Swift
@MainActor public init(destinationProviders: [DestinationType : any ViewDestinationProviding], startingDestination: DestinationPresentation<DestinationType, ContentType, TabType>, routesToIgnore: [DestinationType]? = nil)Parameters
destinationProvidersA dictionary of Destination providers whose keys are an enum of Destination types. The Destination type represents the type of Destination each provider can provide.
startingDestinationThe starting Destination.
routesToIgnoreAn optional list of routes to ignore when checking for Provider assignments.
-
Declaration
Swift
@MainActor public func start() -
Return an existing destination or build a new one
Declaration
Swift
@MainActor public func destination(for configuration: DestinationPresentation<DestinationType, ContentType, TabType>) -> (any ViewDestinationable<DestinationType, ContentType, TabType>)? -
Declaration
Swift
@discardableResult @MainActor public func presentDestination(configuration: DestinationPresentation<DestinationType, ContentType, TabType>) -> (any ViewDestinationable<DestinationType, ContentType, TabType>)? -
Declaration
Swift
@MainActor public func presentationCompletionClosure(for configuration: DestinationPresentation<DestinationType, ContentType, TabType>, destination: (any Destinationable<DestinationType, ContentType, TabType>)? = nil) -> PresentationCompletionClosure? -
Declaration
Swift
@MainActor public func didRequestCurrentDestinationChange(newDestinationID: UUID)
View on GitHub