TabBarViewDestinationInterfacing
@MainActor
public protocol TabBarViewDestinationInterfacing<TabType> : TabBarDestinationInterfacing, ViewDestinationInterfacing where Self.Destination : TabBarViewDestinationable
A protocol defining a SwiftUI View which handles a TabView and conforms to Destinations.
-
Declaration
Swift
associatedtype Destination -
replaceViews(in:Default implementationwith: ) Replaces a
Viewin the specified tab with a new one.Default Implementation
Declaration
Swift
@MainActor func replaceViews(in tab: TabType, with newDestinationID: UUID)Parameters
viewThe
Viewto be replaced.tabThe tab type of the
Viewto be replaced.newViewThe new
View. -
tabIndex(for:Default implementation) Returns the
tabIndexfor the requested tab type.Default Implementation
Declaration
Swift
@MainActor func tabIndex(for tab: TabType) -> Int?Parameters
tabThe tab type.
Return Value
The
tabIndexof 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
destinationIDThe 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.tabNotFounderror being thrown.Default Implementation
Declaration
Swift
@MainActor func gotoTab(_ type: TabType) throwsParameters
typeThe type of tab to make to.
View on GitHub