Right-to-left languages

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

Pick the fix

A custom back-arrow image points the wrong way in Arabic. Fix?

Options
Hint 1 of 1

Directional images should mirror.

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

Show answer

Answer: A Use the SF Symbol chevron.backward, or mark the image to flip for right-to-left layouts

Correct. Directional images should mirror with the layout.

Why not the others?
  • B Ship a separate Arabic build. It's unnecessary; the system mirrors.
  • C Rotate the image 180 degrees everywhere. It would point the wrong way in left-to-right languages.
  • D Force left-to-right layout for the whole app. That breaks the experience for right-to-left readers.

30-second answer

Lay out with leading and trailing, never left and right, so the interface mirrors automatically in Arabic and Hebrew. Use SF Symbols with directional variants (such as chevron.backward) and mark custom directional images to flip. Don't flip things that aren't directional, such as media playback controls, clocks or logos, and keep numbers and phone numbers readable. Test with the right-to-left pseudolanguage.

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

Explain right-to-left support.

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

  • Leading/trailing
  • Directional images
  • What not to flip
  • Pseudolanguage testing

Deep dive

SwiftUI and Auto Layout mirror leading and trailing automatically.

Use .flipsForRightToLeftLayoutDirection(true) or imageFlippedForRightToLeftLayoutDirection() for custom arrows.

Text alignment should be natural, not left.

Swipe gestures and progress directions also mirror.

Common mistakes

  • Hard-coded left/right constraints.
  • Flipping media playback controls.

Senior take & follow-ups

Seniors know what mirrors, what doesn't, and how to test it.

Follow-up questions

Think of your answer first, then open the hint.

  1. Should a play button flip?

    Show hint

    No; playback direction is universal.

  2. How do you test without translations?

    Show hint

    The Right-to-Left Pseudolanguage scheme option.

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