ControllerFlowable
@MainActor
public protocol ControllerFlowable<DestinationType, ContentType, TabType> : Flowable where Self.InterfaceCoordinator == DestinationUIKitCoordinator, Self.PresentationType == DestinationPresentationType<Self.DestinationType, Self.ContentType, Self.TabType>
This protocol represents a Flow which coordinates routing and navigation as a user moves through a UIKit-based app.
-
An enum which defines available Destination presentation types. Typically this is
DestinationPresentationType.Declaration
Swift
typealias PresentationType = DestinationPresentationType<DestinationType, ContentType, TabType> -
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.
Declaration
Swift
@MainActor var destinationProviders: [DestinationType : any ControllerDestinationProviding] { get set } -
Provides a Destination based on the provided configuration model.
Declaration
Swift
@MainActor func destination(for configuration: DestinationPresentation<DestinationType, ContentType, TabType>) -> (any ControllerDestinationable<DestinationType, ContentType, TabType>)?Parameters
configurationThe presentation configuration model describing the Destination to return.
Return Value
The requested Destination, if one was found or able to be built.
-
buildDestination(for:Default implementation) Builds and returns a new Destination based on the supplied configuration model.
Default Implementation
Declaration
Swift
@MainActor func buildDestination(for configuration: DestinationPresentation<DestinationType, ContentType, TabType>) -> (any ControllerDestinationable<DestinationType, ContentType, TabType>)?Parameters
configurationA presentation configuration model to build the Destination.
Return Value
The created Destination, if one could be built.
-
Presents a Destination based on the supplied configuration model.
Declaration
Swift
@discardableResult @MainActor func presentDestination(configuration: DestinationPresentation<DestinationType, ContentType, TabType>) -> (any ControllerDestinationable<DestinationType, ContentType, TabType>)?Parameters
configurationA presentation configuration model by which to find or build a Destination.
Return Value
The presented Destination, if one was found or created.
-
updateDestinationConfiguration(configuration:Default implementationdestination: ) Updates a presentation configuration model.
Default Implementation
Declaration
Swift
@MainActor func updateDestinationConfiguration(configuration: inout DestinationPresentation<DestinationType, ContentType, TabType>, destination: inout some ControllerDestinationable<DestinationType, ContentType, TabType>)Parameters
configurationA presentation configuration model to update.
destinationA Destination to update.
-
findTabBarInViewHierarchy(currentDestination:Default implementation) Finds the closest Destination in the view hierarchy whose interface is a
UITabBarController.Default Implementation
Declaration
Swift
@MainActor func findTabBarInViewHierarchy(currentDestination: any ControllerDestinationable) -> (any TabBarControllerDestinationable<DestinationType, ContentType, TabType>)?Parameters
currentDestinationThe Destination to start searching at.
Return Value
Returns a Destination, if one was found.
-
findNavigatorInViewHierarchy(searchDestination:Default implementation) Finds the closest navigator in the view hierarchy to the provided Destination.
Default Implementation
Declaration
Swift
@MainActor func findNavigatorInViewHierarchy(searchDestination: any ControllerDestinationable) -> (any DestinationPathNavigating)?Parameters
currentDestinationThe Destination to start searching at.
Return Value
Returns a navigator, if one was found.
-
findSplitViewInViewHierarchy(currentDestination:Default implementation) Finds the closest Destination in the view hierarchy whose interface is a
UISplitViewController.Default Implementation
Declaration
Swift
@MainActor func findSplitViewInViewHierarchy(currentDestination: any ControllerDestinationable) -> (any SplitViewControllerDestinationable<DestinationType, ContentType, TabType>)?Parameters
currentDestinationThe Destination to start searching at.
Return Value
Returns a Destination, if one was found.
-
findNearestNavigatorInViewHierarchy(currentDestination:Default implementation) Finds the closest navigator in the view hierarchy to the provided Destination.
Default Implementation
Declaration
Swift
@MainActor func findNearestNavigatorInViewHierarchy(currentDestination: any ControllerDestinationable) -> (any NavigatingControllerDestinationable<DestinationType, ContentType, TabType>)?Parameters
currentDestinationThe Destination to start searching at.
Return Value
Returns a navigator, if one was found.
-
Assigns a controller to serve as the base controller of this Flow’s Destinations.
Declaration
Swift
@MainActor func assignBaseController(_ baseController: any ControllerDestinationInterfacing)Parameters
baseControllerThe root controller.
-
findNearestDestination(of:Default implementationcurrentLevel: ) Finds the nearest Destination of the specified type in the UI hierarchy.
Default Implementation
Declaration
Swift
@MainActor func findNearestDestination(of typeToFind: DestinationType, currentLevel: any ControllerDestinationable<DestinationType, ContentType, TabType>) -> (any ControllerDestinationable<DestinationType, ContentType, TabType>)?Parameters
typeToFindThe type of Destination to find.
currentLevelThe current hierarchy level to search at.
Return Value
A Destination of the specified type, if one was found.
-
providersPreflight(routesToIgnore:Default implementation) This method raises a runtime assert if any Routes in a Flow do not have a Provider assigned to them. It is called automatically by
ControllerFlow.Default Implementation
Declaration
Swift
@MainActor func providersPreflight(routesToIgnore: [DestinationType]?)Parameters
routesToIgnoreAn optional list of routes to ignore when checking for Provider assignments.
-
presentNextDestinationInQueue(contentToPass:Extension method) Declaration
Swift
@discardableResult @MainActor func presentNextDestinationInQueue(contentToPass: ContentType? = nil) -> (any Destinationable<DestinationType, ContentType, TabType>)? -
removeDestinationsBefore(nearest:Extension method) Undocumented
Declaration
Swift
@MainActor func removeDestinationsBefore(nearest typeToFind: DestinationType) -> (any ControllerDestinationable<DestinationType, ContentType, TabType>)? -
removeParentDestination(for:Extension methoduntil: ) Undocumented
Declaration
Swift
@MainActor func removeParentDestination(for destination: any ControllerDestinationable<DestinationType, ContentType, TabType>, until type: DestinationType) -
defaultCompletionClosure(configuration:Extension methoddestination: ) Declaration
Swift
@MainActor func defaultCompletionClosure(configuration: DestinationPresentation<DestinationType, ContentType, TabType>, destination: (any Destinationable<DestinationType, ContentType, TabType>)? = nil) -> PresentationCompletionClosure? -
defaultSheetDismissalCompletionClosure(configuration:Extension method) Declaration
Swift
@MainActor func defaultSheetDismissalCompletionClosure(configuration: DestinationPresentation<DestinationType, ContentType, TabType>) -> PresentationCompletionClosure? -
defaultNavigationBackCompletionClosure(configuration:Extension method) Declaration
Swift
@MainActor func defaultNavigationBackCompletionClosure(configuration: DestinationPresentation<DestinationType, ContentType, TabType>) -> PresentationCompletionClosure?
View on GitHub