disabled(_:)
Controls whether users can interact with this tab.
Declaration
nonisolated func disabled(_ disabled: Bool) -> some TabContent<Self.TabValue>
Parameters
- disabled:
A Boolean value that determines whether users can interact with this tab.
Discussion
The following example shows a TabView with one tab that is not selectable.
TabView {
Tab("Home", systemImage: "house") {
HomeView()
}
Tab("Alerts", systemImage: "bell") {
AlertsView()
}
.disabled(alertsDisabled)
}See Also
Configuring tab content
badge(_:)contextMenu(menuItems:)customizationBehavior(_:for:)customizationID(_:)defaultSectionExpansion(_:)TabSectionExpansiondefaultVisibility(_:for:)draggable(_:)dropDestination(for:action:)help(_:)hidden(_:)popover(isPresented:attachmentAnchor:arrowEdge:content:)popover(item:attachmentAnchor:arrowEdge:content:)sectionActions(content:)springLoadingBehavior(_:)