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

accessibilityLabel(_:)

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

Declaration 宣言

func accessibilityLabel(_ label: Text) -> ModifiedContent<Self, AccessibilityAttachmentModifier>

Discussion 議論

Use this method to provide an accessibility label for a view that doesn’t display text, like an icon. For example, you could use this method to label a button that plays music with the text “Play”. Don’t include text in the label that repeats information that users already have. For example, don’t use the label “Play button” because a button already has a trait that identifies it as a button. このメソッドを使って、アクセシビリティラベルを、テキストを表示しないビュー、アイコンなどに提供してください。例えば、あなたはこのメソッドを使って、音楽を再生するボタンにテキスト “Play” でラベルをつけられます。ユーザが既に持つ情報を繰り返すテキストをラベルの中に含めないでください。例えば、ラベル “Play button” を使わないでください、なぜならボタンは既にそれをボタンと識別する特徴を持つからです。

See Also 参照

Labels