TabBarControllerDestinationInterfacing
@MainActor
public protocol TabBarControllerDestinationInterfacing<TabType> : UITabBarController, ControllerDestinationInterfacing, TabBarDestinationInterfacing where Self.Destination : TabBarControllerDestinationable, Self.TabType == Self.Destination.TabType
A protocol representing a UITabBarController
class which conforms to Destinations.
-
currentController(for:
Default implementation) Returns the currently presented controller in the specified tab.
Default Implementation
Declaration
Swift
@MainActor func currentController(for tab: TabType) -> (any ControllerDestinationInterfacing)?
Parameters
tab
The tab type.
Return Value
A
UIViewController
, if one is found. -
This method gives a chance to customize
UITabItem
s during tabs setup, and should be implemented in concreteUITabBarController
classes conforming to this protocol.Declaration
Swift
@MainActor func customizeTabItem(for tab: TabType, navigationController: UINavigationController)
Parameters
tab
The tab to customize.
navigationController
The navigation controller whose
tabItem
property should be customized. -
tabIndex(for:
Default implementation) Returns the
tabIndex
for the requested tab type.Default Implementation
Declaration
Swift
@MainActor func tabIndex(for tab: TabType) -> Int?
Parameters
tab
The tab type.
Return Value
The
tabIndex
of the tab, if the requested tab type was found. -
tab(destinationID:
Default implementation) Returns a tab type associated with the specified Destination.
Default Implementation
Declaration
Swift
@MainActor func tab(destinationID: UUID) -> TabType?
Parameters
destinationID
The Destination identifier associated with the requested tab.
Return Value
The requested tab type, if one was found.
-
gotoTab(_:
Default implementation) Switches the active tab
Note: Requesting a tab type that isn’t in the active tabs list will result in a
DestinationsError.tabNotFound
error being thrown.Default Implementation
Declaration
Swift
@MainActor func gotoTab(_ type: TabType) throws
Parameters
type
The type of tab to make to.