r/iOSProgramming • • 35m 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?

3 Upvotes

2 comments sorted by

View all comments

•

u/onefish857 23m ago

performAccessibilityAudit() in a ui test will catch a lot of the missing-label / contrast / hit-target stuff, it's been in xctest since ios 17. it still won't see a focus trap or a bad reading order though. for the card issue i'd just ban .accessibilityElement(children: .combine) on any container that has its own buttons, that's a very common agent habit.