r/iOSProgramming • • 20h ago

Discussion Agent written SwiftUI keeps breaking accessibility and nobody notices

Our iOS app has a lot of older users, and accessibility matters for us, about 9% of sessions use VoiceOver or a large dynamic type size. Since agents started writing most new screens, our accessibility has been quietly getting worse.

What a blind user's email made us find last month:

- icon only buttons with no accessibility label, so VoiceOver reads "button"
- a custom card that groups 5 elements into one, so you can't reach the delete action
- text in fixed frames that gets cut off at larger type sizes
- a sheet that traps focus when it opens

coderabbit catches some of it in review, like an Image used as a button without a label. But reading order and what happens at the largest text size don't show up in a diff, and none of us test with VoiceOver on every PR.

What's helped so far:

- accessibility snapshot tests at 3 dynamic type sizes for our main screens
- a short accessibility section in the agent's instructions
- one person doing a 10 minute VoiceOver pass before each release

How do other iOS teams keep accessibility from slipping when agents write the UI? Anything automated that actually catches the VoiceOver problems?

8 Upvotes

13 comments sorted by

View all comments

3

u/dawedev 20h ago

Cheap trick for the large text part: make the agent add a #Preview at .dynamicTypeSize(.accessibility5) for every new screen. Then the cut-off fixed frames show up in Xcode before anyone opens a PR. Won't catch the focus trap, but it's one less thing for the manual pass.