Supporting VoiceOver

Accessibility & localization Mid-level Swift 5.0+ iOS 17+ Reviewed By Alok Singh

Fill the blank

Fill the blank with the best hint.

Button { cart.add(item) } label: {
    Image(systemName: "cart.badge.plus")
}
.accessibilityLabel("Add to cart")
.accessibilityHint(____)
Options
Hint 1 of 1

Hints describe what happens.

Choose an answer, then open Show answer below to check it.

Show answer

Answer: A "Adds \(item.name) to your cart."

Correct. A hint describes the result of the action.

Why not the others?
  • B "Double tap to add to cart.". VoiceOver already says how to activate; hints shouldn't describe gestures.
  • C "Button". The button trait is announced automatically.
  • D "cart.badge.plus". Symbol names mean nothing to users.

30-second answer

Give every meaningful element a concise label that says what it is, add a value for state, and a hint only when the result of an action isn't obvious. Hints describe the result, such as 'Adds the item to your cart', not the gesture, because VoiceOver already announces how to activate. Use traits (button, header, selected), group related elements, hide decorative images, and test with VoiceOver on a device.

Practise saying it · 45 s. No recording, just a timer

Explain how you support VoiceOver.

Say your answer out loud, then check which of these points you covered:

  • Labels, values, hints
  • Traits and grouping
  • Test on device

Deep dive

Standard controls are accessible by default; custom ones need work.

Use .accessibilityAddTraits(.isHeader) for rotor navigation.

Custom actions keep swipe actions available to VoiceOver users.

Check colour contrast and don't rely on colour alone.

Common mistakes

  • Labels that repeat the type ('Add button').
  • Hints that describe the gesture.

Senior take & follow-ups

Seniors test with VoiceOver themselves and write labels from the user's point of view.

Follow-up questions

Think of your answer first, then open the hint.

  1. Label, value or hint?

    Show hint

    What it is, its current state, what happens.

  2. How do VoiceOver users reach swipe actions?

    Show hint

    Custom accessibility actions.

Suggest a fix if something here is wrong or out of date.