As the iOS lead, what accessibility standard must a SwiftUI feature meet before it ships, and how does the team check it without slowing every release?
answer
- a definition of done, not a hope
- cheap checks on every change
- the largest text size preview
- caps are reviewed exceptions
- VoiceOver on a real device
basics
~20 sWrite the standard as checkable SwiftUI outcomes: labelled controls, rows read as one element, adjustable custom controls, layouts that survive accessibility5, honoured motion settings. Then tier the checks: review and previews per change, a VoiceOver pass per feature, deeper audits per release.
solid answer
~50 sI write the standard as outcomes a reviewer can verify in SwiftUI terms: every interactive element has a short label, ideally from a titled `Button` or `Label` with `.iconOnly`; decorative images use `Image(decorative:)`; list rows read as one element with named actions; custom controls expose a value and adjust; text uses text styles and fixed metrics use `@ScaledMetric`; each dense screen has a `.dynamicTypeSize(.accessibility5)` preview; motion and color respect the environment settings. Then I tier the checks by cost. Code review and previews run on every pull request; the author does a VoiceOver and largest-size pass on a device per feature; release candidates get a deeper audit and, ideally, time with people who use VoiceOver daily. The judgment calls are which items block a merge, who may approve a Dynamic Type cap, and how much goes into shared components so features inherit it.
code
swift · 28 linesimport SwiftUI
struct MiniPlayerBar: View {
let title: String
var body: some View {
HStack {
Text(title).lineLimit(1)
Spacer()
Button("Play", systemImage: "play.fill") {}
.labelStyle(.iconOnly)
.accessibilityShowsLargeContentViewer()
}
.padding()
// A deliberate, reviewed exception: the bar stops growing at accessibility2,
// and the large content viewer shows the button at full size on long press.
.dynamicTypeSize(...DynamicTypeSize.accessibility2)
}
}
#Preview("Default size") {
MiniPlayerBar(title: "Evening Tide")
}
#Preview("accessibility5") {
MiniPlayerBar(title: "Evening Tide")
.dynamicTypeSize(.accessibility5)
}go deeper
Know the checklist items for your own pull request: labels on icon-only controls, decorative images, a preview at the largest text size, and a quick VoiceOver swipe through the new screen.
Explain how each checklist item maps to a SwiftUI API and how to verify it in previews or with VoiceOver, so a reviewer can confirm it without guessing.
Run the per-feature VoiceOver and largest-size pass, catch the issues automation misses, such as reading order and chatty rows, and turn repeated fixes into shared components.
Own the tradeoffs: which items gate a merge, who approves a Dynamic Type cap, how much to invest in the design system so features are accessible by default, and how to bring in real users.
## Why a written standard Without a standard, accessibility in a SwiftUI app depends on which engineer built a screen. Icon-only buttons ship unlabeled, some rows read as four stops and others as one, and the largest text sizes are checked only when a person complains. A lead's job is to turn intentions into **outcomes a reviewer can verify**, and then to choose checks whose cost matches how often they run. The general principles of accessible design belong to the foundations material; this is about what a SwiftUI feature must show. ## The standard, in SwiftUI terms A feature is done when: 1. **Every interactive element has a short spoken name.** Prefer a titled `Button` or `Label` with `.labelStyle(.iconOnly)`, and use `accessibilityLabel` for a bare image. Labels never repeat the role. 2. **Decorative content is hidden**, with `Image(decorative:)` or `accessibilityHidden(true)`. 3. **Rows read as one element**, using `accessibilityElement(children:)`, with nested operations exposed through `accessibilityAction(named:)`. 4. **Custom controls report a value and adjust**, through `accessibilityAdjustableAction` or an `accessibilityRepresentation` with a standard control. 5. **Text uses text styles, and fixed sizes use `@ScaledMetric`.** Each dense screen has a preview at `.dynamicTypeSize(.accessibility5)`. 6. **Motion and color respect the environment:** `accessibilityReduceMotion`, `colorSchemeContrast` and `accessibilityDifferentiateWithoutColor`. 7. **Any `dynamicTypeSize` cap is an approved exception**, paired with `accessibilityShowsLargeContentViewer()` where the control stays small. ## Tiering the checks by cost | Check | When | Catches | Misses | |---|---|---|---| | Code review against the list | Every pull request | Missing labels, caps, fixed metrics | Anything that needs running | | `accessibility5` previews | Every pull request | Clipping, truncation, overlap | Spoken output | | Author's VoiceOver pass on a device | Every feature | Reading order, chatty rows, unreachable actions | Long-tail screens | | Automated audits in the UI-test suite and Xcode's inspector | Nightly or per release | Regressions in labels and contrast | Whether the flow makes sense | | Sessions with people who use VoiceOver daily | A few times a year | Real usability problems | Little, but it is expensive | UI-test audits and the Accessibility Inspector are covered with UI testing and Xcode tooling. Here the point is where they sit: they guard against regression, and they do not prove usability. ## The judgment calls - **What blocks a merge.** Gate on objective, cheap items: an unlabeled control, a missing value on a custom control, a missing `accessibility5` preview, an unapproved cap. Leave wording and reading order to the VoiceOver pass, where a human can judge them. - **Who approves a Dynamic Type cap.** Apple's documentation suggests a large content view for constrained views, and warns that it is not a replacement for Dynamic Type. Make a cap visible in review and rare in practice. - **Where the investment goes.** Every rule built into a design-system component, such as a button that requires a title or a row that groups itself, is a rule no feature can forget. Early investment there costs more in the first quarter and much less afterwards. - **How strict to be on legacy screens.** Applying the standard to new and touched code, with a short backlog for the worst existing screens, usually beats a freeze that stops feature work. - **Real users.** Automated checks pass on screens that are still hard to use. Budget for feedback from people who rely on VoiceOver and large text. ## Signs the standard is working - Accessibility bugs reported by users trend down, and new ones are found in review or in the VoiceOver pass rather than in production. - Review comments shift from "add a label" to edge cases, because the defaults cover the basics. - Caps are rare, named and justified. - New engineers learn the list in their first pull request, not from a post-incident review. ## Common failure modes - A standard written as principles, with no SwiftUI check that a reviewer can apply. - Accessibility left to a pre-release sprint, when every fix is the most expensive it will ever be. - An app-wide `dynamicTypeSize` cap added to keep a layout stable, which removes the largest sizes for everyone. - Treating a green automated audit as proof that VoiceOver users can complete the task.
- Which items should block a merge, and which should only warn?Block on what is objective and cheap to fix at review time: an unlabeled control, a custom control with no value or adjustment, a dense screen without an accessibility5 preview, an unapproved `dynamicTypeSize` cap. Warn on judgment items such as the wording of a hint or the reading order of a complex card, which belong in the per-feature VoiceOver pass rather than a hard gate.
- How do you keep the per-feature cost from growing as the app grows?Move the standard into shared code. A design-system button that requires a title, a row component that already groups and exposes named actions, controls built on standard counterparts with `accessibilityRepresentation`, and color tokens with high-contrast variants turn most checklist items into defaults. Review then concentrates on the custom parts.
- Automated checks pass, yet a VoiceOver user reports the screen is hard to use; what happened?Automated checks find missing labels and clipped text, but not whether the experience makes sense: reading order, chatty rows, actions that are hard to discover, or a flow that needs too many swipes. That is why the standard keeps a manual VoiceOver pass per feature and, ideally, sessions with people who use VoiceOver every day.
- Treating a passing automated audit as proof the screen is usable with VoiceOver
- Capping dynamicTypeSize app-wide to keep layouts stable
- Running accessibility checks only in the week before release
- A standard written as principles with no SwiftUI checks a reviewer can verify
- Fixing accessibility screen by screen instead of in shared components