DestinationPresentationConfiguring
@MainActor
public protocol DestinationPresentationConfiguring<DestinationType, TabType, ContentType> : AnyObject
This protocol represents a configuration object for the presentation of a Destination. Classes adopting this protocol should handle the presentation of Destinations within the system UI framework being used.
-
An enum which defines all routable Destinations in the app.
Declaration
Swift
associatedtype DestinationType : RoutableDestinations
-
An enum which defines the types of content that are able to be sent through Destinations.
Declaration
Swift
associatedtype ContentType : ContentTypeable
-
An enum which defines types of tabs in a tab bar.
Declaration
Swift
associatedtype TabType : TabTypeable
-
A
DestinationPresentationType
configured for this configuration object.Declaration
Swift
typealias PresentationType = DestinationPresentationType<Self>
-
A unique identifier.
Declaration
Swift
@MainActor var id: UUID { get }
-
An enum representing the type of Destination to be presented.
Declaration
Swift
@MainActor var destinationType: DestinationType? { get set }
-
An enum type representing the way this Destination should be presented.
Declaration
Swift
@MainActor var presentationType: PresentationType { get }
-
The unique identifier of the currently presented Destination.
Declaration
Swift
@MainActor var currentDestinationID: UUID? { get set }
-
The unique identifier of the parent of the Destination to be presented.
Declaration
Swift
@MainActor var parentDestinationID: UUID? { get set }
-
An enum type representing the content to be used with this presentation.
Declaration
Swift
@MainActor var contentType: ContentType? { get set }
-
An enum representing the type of action used with this presentation.
Declaration
Swift
@MainActor var actionType: DestinationActionType { get }
-
The unique identifier of the target of this presentation, if one exists.
Declaration
Swift
@MainActor var actionTargetID: UUID? { get set }
-
The type of
InterfaceAction
assistant to be used to configure this presentation.Declaration
Swift
@MainActor var assistantType: ActionAssistantType { get set }
-
The
DestinationPathNavigating
object associated with the Destination to be presented.Declaration
Swift
@MainActor var navigator: (any DestinationPathNavigating)? { get set }
-
An options model that configures how a Destination is presented within a navigation stack. Currently this only applies to UIKit navigation controller presentations.
Declaration
Swift
@MainActor var navigationStackOptions: NavigationStackPresentationOptions? { get set }
-
A reference to a
TabBarViewDestinationable
object, should one currently exist in the UI hierarchy.Declaration
Swift
@MainActor var tabBarDestination: (any TabBarViewDestinationable<Self, TabType>)? { get set }
-
A reference to a
TabBarControllerDestinationable
object, should one currently exist in the UI hierarchy.Declaration
Swift
@MainActor var tabBarControllerDestination: (any TabBarControllerDestinationable<Self, TabType>)? { get set }
-
A Boolean which determines whether the activation of the presentation’s completion closure, referenced in the
completionClosure
property, should be delayed.Declaration
Swift
@MainActor var shouldDelayCompletionActivation: Bool { get set }
-
A Boolean which determines whether the Destination configured by this presentation should become the current one within the
Flowable
andGroupedDestinationable
objects which manage it.The Destinations protocols and classes which handle UINavigationControllers/NavigationStacks and UITabController/TabBars ignore this property. Custom classes which conform to one of these protocols should handle this property appropriately, though generally speaking if a Destination is added to a
GroupedDestinationable
object, it would be a good user experience for that Destination to become the focus. This may vary based on how your custom group’s children are displayed to the user.Important
Setting this property tofalse
can have side effects on the presentation of future Destinations withinGroupedDestinationable
objects whose placement depends on the location of a previous Destination. For example, if you present a Destination in a non-active child of aGroupedDestinationable
object with this property set tofalse
, then present another Destination with apresentationType
ofnavigationController
, depending on how you handle this property the Destination may not be put into the same child of the group because the active child will be different than if this property had beentrue
. To overcome this, you would need to use apresentationType
on the second presentation that targets the same child directly.Declaration
Swift
@MainActor var shouldSetDestinationAsCurrent: Bool { get set }
-
A completion closure which should be run upon completion of the presentation of the Destination.
Declaration
Swift
@MainActor var completionClosure: ((_ didComplete: Bool) -> Void)? { get set }
-
handlePresentation(destinationToPresent:
rootController: currentDestination: parentOfCurrentDestination: removeDestinationClosure: ) Handles the presentation of a UIKit-based Destination.
Declaration
Swift
@MainActor func handlePresentation(destinationToPresent: (any ControllerDestinationable<Self>)?, rootController: (any ControllerDestinationInterfacing)?, currentDestination: (any ControllerDestinationable)?, parentOfCurrentDestination: (any ControllerDestinationable)?, removeDestinationClosure: RemoveDestinationFromFlowClosure?)
Parameters
destinationToPresent
The
ControllerDestinationable
Destination to present.rootController
A
ControllerDestinationInterfacing
object representing the root of the UI hierarchy.currentDestination
A
ControllerDestinationable
object, representing the currently presented Destination.parentOfCurrentDestination
A
ControllerDestinationable
object, representing the parent of the current Destination.removeDestinationClosure
An optional closure to the run when the Destination is removed from the UI hierarchy.
-
handlePresentation(destinationToPresent:
currentDestination: parentOfCurrentDestination: removeDestinationClosure: ) Handles the presentation of a SwiftUI-based Destination.
Declaration
Swift
@MainActor func handlePresentation(destinationToPresent: (any ViewDestinationable<Self>)?, currentDestination: (any ViewDestinationable<Self>)?, parentOfCurrentDestination: (any ViewDestinationable)?, removeDestinationClosure: RemoveDestinationFromFlowClosure?)
Parameters
destinationToPresent
The
ViewDestinationable
Destination to present.rootController
A
UIViewController
representing the root of the UI hierarchy.currentDestination
A
ViewDestinationable
object, representing the currently presented Destination.parentOfCurrentDestination
A
ViewDestinationable
object, representing the parent of the current Destination.removeDestinationClosure
An optional closure to the run when the Destination is removed from the UI hierarchy.
-
Creates a copy of this object.
Declaration
Swift
@MainActor func copy() -> Self
Return Value
A copy of this object.