Instance Method インスタンスメソッド

accessibilityLabel(_:)

Adds a label to the view that describes its contents. ビューにそれの内容を記述するラベルを加えます。

Declaration 宣言

func accessibilityLabel(_ labelKey: LocalizedStringKey) -> Text

Parameters パラメータ

labelKey

The string key for the alternative accessibility label.

Discussion 議論

Use this method to provide an alternative accessibility label to the text that is displayed. For example, you can give an alternate label to a navigation title:


var body: some View {
    NavigationView {
        ContentView()
            .navigationTitle(Text("􀈤").accessibilityLabel("Inbox"))
    }
}

See Also 参照

Providing Accessibility Information