Please, don't use accessibility labels as ids for your UI tests. It can completely ruin the experience for VoiceOver users. There is actually an accessibility identifier property that you can use instead to uniquely identify your UI elements.

An app for booking flights has used the accessibility label property to uniquely identify elements, presumably for finding those elements on their UI tests. That means that VoiceOver will start reading something like “Plan underscore trip underscore ban underscore airport underscore description underscore label. Plan underscore trip underscore ban underscore origin underscore airport underscore gps underscore icon. Plan underscore trip underscore btn underscore airport underscore title underscore label”, instead of a more understandable sequence of labels, something like “From. London Gatwick”.

You may also find interesting...

Custom actions work as great on Switch Control as they do in VoiceOver. It makes navigation much, much, faster and you’ll be able to find all those custom actions in the Switch Control menu.

An interesting speech attribute for attributed accessibility labels is accessibilitySpeechIPANotation that lets you specify how VoiceOver should pronounce a label with the International Phonetic Alphabet (IPA) notation. https://developer.apple.com/documentation/foundation/nsattributedstring/key/accessibilityspeechipanotation

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. 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:)

Created in Swift with Ignite.

Supporting Swift for Swifts