TabBarControllerDestinationable
@MainActor
public protocol TabBarControllerDestinationable<DestinationType, ContentType, TabType> : GroupedControllerDestinationable
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 } -
Update the currently selected tab.
Declaration
Swift
@MainActor func updateSelectedTab(type: TabType) throwsParameters
tabThe 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<DestinationType, ContentType, TabType>)?Parameters
tabThe tab type.
Return Value
A
View-based Destination, if one was found. -
A closure to be run when the
selectedTabproperty changed.Declaration
Swift
@MainActor var selectedTabUpdatedClosure: TabBarControllerSelectedTabUpdatedClosure<TabType>? { get set } -
presentDestination(destination:in: shouldUpdateSelectedTab: presentationOptions: removeDestinationFromFlowClosure: ) Presents a Destination in a tab.
Note
This method will throw an error if the requested tab is not found.Declaration
Swift
@MainActor func presentDestination(destination: any ControllerDestinationable<DestinationType, ContentType, TabType>, in tab: TabType, shouldUpdateSelectedTab: Bool, presentationOptions: NavigationStackPresentationOptions?, removeDestinationFromFlowClosure: RemoveDestinationFromFlowClosure?) throwsParameters
destinationA UIKit-based Destination to be presented.
tabThe tab type to present this Destination in.
shouldUpdateSelectedTabDetermines whether the selected tab should be updated.
presentationOptionsA model which provides options for presenting this Destination in the
UINavigationControllerwithin the tab, including determining whether the presentation should be animated. -
registerNavigationControllerDelegates(with:Default implementation) Registers the specified
UINavigationControllerDelegatewith theUINavigationControllerroot objects in each tab.Default Implementation
Declaration
Swift
@MainActor func registerNavigationControllerDelegates(with coordinator: any DestinationUIKitCoordinating)Parameters
coordinatorThe
UINavigationControllerDelegatecoordinator 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
destinationIDThe 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
typeThe type of tab.
Return Value
A tab model, if one was found in the
activeTabsarray. -
tab(containing:Default implementation) Returns the tab which contains the specified
UIViewController.Default Implementation
Declaration
Swift
@MainActor func tab(containing controllerToMatch: UIViewController) -> TabType?Parameters
controllerToMatchA 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
activeTabsarray.Default Implementation
Declaration
Swift
@MainActor func tabIndex(for type: TabType) -> Int?Parameters
typeThe 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
closureThe closure to run.
-
supportsIgnoringCurrentDestinationStatusExtension methodUndocumented
Declaration
Swift
@MainActor var supportsIgnoringCurrentDestinationStatus: Bool { get } -
replaceChild(currentID:Extension methodwith: removeDestinationFromFlowClosure: ) Declaration
Swift
@MainActor func replaceChild(currentID: UUID, with newDestination: any Destinationable<DestinationType, ContentType, TabType>, removeDestinationFromFlowClosure: RemoveDestinationFromFlowClosure? = nil)
View on GitHub