TabBarControllerDestinationable
@MainActor
public protocol TabBarControllerDestinationable<PresentationConfiguration, TabType> : ControllerDestinationable, GroupedDestinationable where Self.ControllerType : TabBarControllerDestinationInterfacing, Self.TabType == Self.ControllerType.TabType
This protocol represents a Destination whose interface is a UITabBarController
.
-
A dictionary of UINavigationControllers whose keys are their associated tab types.
Declaration
Swift
@MainActor var navControllersForTabs: [TabType : UINavigationController] { get set }
-
A dictionary of Destination identifiers whose keys are their associated tab types.
Declaration
Swift
@MainActor var destinationIDsForTabs: [TabType : UUID] { get set }
-
A representation of the tab types that are currently active.
Declaration
Swift
@MainActor var activeTabs: [TabModel<TabType>] { get set }
-
The currently selected tab type.
Declaration
Swift
@MainActor var selectedTab: TabModel<TabType> { get set }
-
updateSelectedTab(type:
Default implementation) Update the currently selected tab.
Default Implementation
Declaration
Swift
@MainActor func updateSelectedTab(type: TabType) throws
Parameters
tab
The tab type to select.
-
currentDestination(for:
Default implementation) Returns the current Destination for the specified tab.
Default Implementation
Declaration
Swift
@MainActor func currentDestination(for tab: TabType) -> (any ControllerDestinationable<PresentationConfiguration>)?
Parameters
tab
The tab type.
Return Value
A
View
-based Destination, if one was found. -
A closure to be run when the
selectedTab
property changed.Declaration
Swift
@MainActor var selectedTabUpdatedClosure: TabBarControllerSelectedTabUpdatedClosure<TabType>? { get set }
-
presentDestination(destination:
Default implementationin: shouldUpdateSelectedTab: presentationOptions: removeDestinationFromFlowClosure: ) Presents a Destination in a tab.
Note
This method will throw an error if the requested tab is not found.Default Implementation
Declaration
Swift
@MainActor func presentDestination(destination: any ControllerDestinationable<PresentationConfiguration>, in tab: TabType, shouldUpdateSelectedTab: Bool, presentationOptions: NavigationStackPresentationOptions?, removeDestinationFromFlowClosure: RemoveDestinationFromFlowClosure?) throws
Parameters
destination
A UIKit-based Destination to be presented.
tab
The tab type to present this Destination in.
shouldUpdateSelectedTab
Determines whether the selected tab should be updated.
presentationOptions
A model which provides options for presenting this Destination in the
UINavigationController
within the tab, including determining whether the presentation should be animated. -
registerNavigationControllerDelegates(with:
Default implementation) Registers the specified
UINavigationControllerDelegate
with theUINavigationController
root objects in each tab.Default Implementation
Declaration
Swift
@MainActor func registerNavigationControllerDelegates(with coordinator: any DestinationUIKitCoordinating)
Parameters
coordinator
The
UINavigationControllerDelegate
coordinator object to register. -
tab(destinationID:
Default implementation) Returns a tab based on its associated Destination identifier.
Default Implementation
Declaration
Swift
@MainActor func tab(destinationID: UUID) -> TabType?
Parameters
destinationID
The Destination identifier.
Return Value
A tab type, if one was found.
-
tab(for:
Default implementation) Returns a tab model for its associated type.
Default Implementation
Declaration
Swift
@MainActor func tab(for type: TabType) -> TabModel<TabType>?
Parameters
type
The type of tab.
Return Value
A tab model, if one was found in the
activeTabs
array. -
tab(containing:
Default implementation) Returns the tab which contains the specified
UIViewController
.Default Implementation
Declaration
Swift
@MainActor func tab(containing controllerToMatch: UIViewController) -> TabType?
Parameters
controllerToMatch
A controller to find.
Return Value
A tab type, if one was found.
-
tabIndex(for:
Default implementation) Returns the index of the specified tab in the
activeTabs
array.Default Implementation
Declaration
Swift
@MainActor func tabIndex(for type: TabType) -> Int?
Parameters
type
The tab type.
Return Value
An array index, if the tab was found in the array.
-
assignSelectedTabUpdatedClosure(closure:
Default implementation) Assigns the closure to be run when the selected tab changes.
Default Implementation
Declaration
Swift
@MainActor func assignSelectedTabUpdatedClosure(closure: @escaping TabBarControllerSelectedTabUpdatedClosure<TabType>)
Parameters
closure
The closure to run.
-
supportsIgnoringCurrentDestinationStatus
Extension methodDeclaration
Swift
@MainActor var supportsIgnoringCurrentDestinationStatus: Bool { get }
-
replaceChild(currentID:
Extension methodwith: removeDestinationFromFlowClosure: ) Declaration
Swift
@MainActor func replaceChild(currentID: UUID, with newDestination: any Destinationable<PresentationConfiguration>, removeDestinationFromFlowClosure: RemoveDestinationFromFlowClosure? = nil)
-
updateChildren()
Extension methodDeclaration
Swift
@MainActor func updateChildren()