ViewFlow
@MainActor
public final class ViewFlow<DestinationType, TabType, ContentType> : ViewFlowable 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
@MainActor public var rootDestination: (any Destinationable<DestinationType, ContentType, TabType>)?
-
Declaration
Swift
@MainActor public var destinationQueue: [DestinationPresentation<DestinationType, ContentType, TabType>]
-
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>)
Parameters
destinationProviders
A dictionary of Destination providers whose keys are an enum of Destination types. The Destination type represents the type of Destination each provider can provide.
startingDestination
The starting Destination.
-
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)