-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Reasoning:
When creating a custom tab bar, I'm forced to do something like:
struct ScrollableTabBar<Tab: DisplayableTab>: View {
@Binding var selectedTab: Tab
var tabs: [Tab]
init(selectedTab: Binding<Tab>, tabs: [Tab]) {
...
providing the tabs array that's synchronized with the actual tabs, and basing the tab labels on my DisplayableTab protocol.
And tabs are registered with:
.materialTabItem(tab: tab) { _, _, _ in
// The tab label is not used due to custom tab bar setup
EmptyView()
}
Different screens may require different tab labels, which can blow up the DisplayableTab eventually.
Solution:
Exposing TabBarModel and HeaderModel would allow to benefit from EnvironmentObject-s to render the tab labels provided by the materialTabItem.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request