Contents

accessibilityInputLabels(_:isEnabled:)

Sets alternate input labels with which users identify a tab.

Declaration

nonisolated func accessibilityInputLabels(_ inputLabelKeys: [LocalizedStringKey], isEnabled: Bool = true) -> some TabContent<Self.TabValue>

Parameters

  • inputLabelKeys:

    The accessibility input labels to apply.

  • isEnabled:

    If true the accessibility input labels are applied; otherwise the accessibility input labels are unchanged.

Discussion

Provide labels in descending order of importance. Voice Control and Full Keyboard Access use the input labels.

var body: some View {
    TabView {
        Tab {
            MessagesView()
        } label: {
            Image(systemName: "mail")
        }
        .accessibilityInputLabels(["Messages", "Mail", "Conversations"])
    }
}