Contents

accessibilityHint(_:isEnabled:)

Communicates to the user what happens after selecting the tab.

Declaration

nonisolated func accessibilityHint(_ hint: LocalizedStringResource, isEnabled: Bool = true) -> some TabContent<Self.TabValue>

Parameters

  • hint:

    The accessibility hint to apply.

  • isEnabled:

    If true the accessibility hint is applied; otherwise the accessibility hint is unchanged.

Discussion

Provide a hint in the form of a brief phrase, like “Open shopping cart” or “Show downloaded attachments”.

var body: some View {
    TabView {
        Tab {
            MessagesView()
        } label: {
            Image(systemName: "play")
        }
        .accessibilityHint("Select videos to download")
    }
}