Label at Front
Any active control with text should have a name that begins with that text, including the text children of the control.
VoiceOver users expect the accessible name announced first when interacting with a control. As a best practice, we recommend having a controls visible text within the name and all other information within the accessible value, hint, or role.
- Turn on VoiceOver
- Focus the element
- One of the following will happen:
- Inaccessible: VoiceOver will announce other text before announcing the active control's text
- Accessible: VoiceOver will announce the active control's text first
An issue found by this rule is caused by the visible text missing from the start of the control's accessibility label.
- Select the element with a
- Ensure that the Inspectors Panel is visible
- Select the Identity Inspector.
- Under Accessibility, there is a category called "Label". Enter a label that either exactly matches or begins with the visible text.
Find where the accessibility label has been set, and verify that the
accessibilityLabel's value either matches or begins with all the visible text of the component.
button.title = "Login"
button.accessibilityLabel = "Login to Your Account"
Ensure to set an accessibility label that either matches or begins with all the visible text of the component.