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

accessibilityLabel(_:)

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

Declaration 宣言

func accessibilityLabel<S>(_ label: S) -> Text where S : StringProtocol

Parameters パラメータ

label

The string 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