← All daysDay 44 of 49 · Part 11: Platform features and shipping
Day 44

Accessibility

These are the lesson notes for this day. Its build-along tutorial and flash cards have not been written yet.

Lesson 50

Accessibility

Standard SwiftUI controls are accessible without any work from you. Your job is to fill the gaps. Give images and icon-only buttons a label with .accessibilityLabel. Combine related elements into one with .accessibilityElement(children: .combine). Expose the values and actions of custom controls. Hide decoration. Support Dynamic Type by using text styles such as .font(.body) instead of fixed sizes, and let your layouts wrap, or switch to a vertical arrangement, at large sizes.

Test with VoiceOver, with the Accessibility Inspector, and with previews at the largest text sizes. Interviewers at large companies ask about this often, and "I test with VoiceOver" is a strong thing to be able to say truthfully.

Exercise

Use your app with VoiceOver only. Fix the three worst problems you find. Then check every screen at the largest accessibility text size.

After this lesson you should be able to answer
  1. What makes an icon-only button accessible?
  2. How do you support Dynamic Type?
  3. How do you test an app's accessibility?
Resources