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.
-
An enum which defines all routable Destinations in the app.
Declaration
Swift
public typealias DestinationType = DestinationType
-
An enum which defines types of tabs in a tab bar.
Declaration
Swift
public typealias TabType = TabType
-
An enum which defines the types of content that are able to be sent through Destinations.
Declaration
Swift
public typealias ContentType = ContentType
-
A model type which configures Destination presentations. Typically this is a
DestinationPresentation
.Declaration
Swift
public typealias PresentationConfiguration = DestinationPresentation<DestinationType, ContentType, TabType>
-
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<PresentationConfiguration>]
-
Declaration
Swift
@MainActor public var currentDestination: (any Destinationable<PresentationConfiguration>)?
-
Declaration
Swift
@MainActor public var destinationProviders: [DestinationType : any ViewDestinationProviding]
-
Declaration
Swift
@MainActor public var uiCoordinator: DestinationSwiftUICoordinator?
-
Declaration
Swift
@MainActor public var rootDestination: (any Destinationable<PresentationConfiguration>)?
-
Declaration
Swift
@MainActor public var destinationQueue: [PresentationConfiguration]
-
The starting Destination in the Flow.
Declaration
Swift
@MainActor public var startingDestination: PresentationConfiguration?
-
The initializer.
Declaration
Swift
@MainActor public init(destinationProviders: [DestinationType : any ViewDestinationProviding], startingDestination: PresentationConfiguration)
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: PresentationConfiguration) -> (any ViewDestinationable<PresentationConfiguration>)?
-
Declaration
Swift
@discardableResult @MainActor public func presentDestination(configuration: PresentationConfiguration) -> (any ViewDestinationable<PresentationConfiguration>)?
-
Declaration
Swift
@MainActor public func presentationCompletionClosure(for configuration: PresentationConfiguration, destination: (any Destinationable<DestinationPresentation<DestinationType, ContentType, TabType>>)? = nil) -> PresentationCompletionClosure?
-
Declaration
Swift
@MainActor public func didRequestCurrentDestinationChange(newDestinationID: UUID)