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

accessibilityLabeledPair(role:id:in:)

Pairs an accessibility element representing a label with the element for the matching content. ラベルを表しているあるアクセシビリティ要素をその合致している内容に対する要素と対にします。

Declaration 宣言

func accessibilityLabeledPair<ID>(role: AccessibilityLabeledPairRole, id: ID, in namespace: Namespace.ID) -> some View where ID : Hashable

Parameters パラメータ

role

Determines whether this element should be used as the label in the pair, or the content in the pair.

id

The identifier for the label / content pair. Elements with matching identifiers within the same namespace will be paired together.

namespace

The namespace used to organize label and content. Label and content under the same namespace with matching identifiers will be paired together.

Discussion 議論

Use accessibilityLabeledPair with a role of AccessibilityLabeledPairRole.label to identify the label, and a role of AccessibilityLabeledPairRole.content to identify the content. This improves the behavior of accessibility features such as VoiceOver when navigating such elements, allowing users to better understand the relationship between them.