With accessibilityRepresentation(representation:), you can create a custom component and it can be perceived by assistive technologies as the view you pass as representation. No need to manually configure accessibility attributes.

A budgeting planner app with custom sliders to configure categories like food and entertainment. All it takes to make it accessible is to use the .accessibilityRepresentation modifier and pass a native Slider configured accordingly. Example and code from “SwiftUI Accessibility: Beyond the basics” from WWDC 21.

It is one of the most interesting additions to SwiftUI to help you develop accessible UI components. If your custom component behaves similarly to a native one, this is the way to go.

https://developer.apple.com/documentation/swiftui/view/accessibilityrepresentation(representation:)

You may also find interesting...

If you want to keep yourself up to date with what’s going on, or what has been published lately, on how to develop more accessible mobile apps, make sure you subscribe to Accessible Mobile Apps Weekly by @RobinKanatzar from @accessible_apps.

Sometimes your UI will just not scale for large text sizes. Simple changes, for large sizes, like disposing elements vertically instead of horizontally, reducing the number of columns, and allowing more lines of text, can do the trick most times.

@azzoor is the developer of the Braille Scanner It uses computer vision to locate the page and Machine Learning to match Braille to letters. You can see English letters above the braille, convert them to speech, copy and paste it... so cool!

Created in Swift with Ignite.

Supporting Swift for Swifts