TabBarViewDestinationInterfacing
@MainActor
public protocol TabBarViewDestinationInterfacing<TabType> : TabBarDestinationInterfacing, ViewDestinationInterfacing where Self.Destination : TabBarViewDestinationable, Self.TabType == Self.Destination.TabType
A protocol defining a SwiftUI View
which handles a TabView
and conforms to Destinations.
-
A model type which configures Destination presentations. Typically this is a
DestinationPresentation
.Declaration
Swift
associatedtype PresentationConfiguration
-
replaceViews(in:
Default implementationwith: ) Replaces a
View
in the specified tab with a new one.Default Implementation
Declaration
Swift
@MainActor func replaceViews(in tab: TabType, with newDestinationID: UUID)
Parameters
view
The
View
to be replaced.tab
The tab type of the
View
to be replaced.newView
The new
View
. -
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.