In SwiftUI there is a very useful modifier accessibilityElement(children:), that will do very different things depending on the AccessibilityChildBehavior passed as a parameter. There are three options: ignore (default), contain, and combine.

accessibilityElement(children:) applied to a view consisting of an HStack, with two VStacks. The first one has three labels: A (with a as identifier), B (with b as identifier), and C (with 0 as value). The second one has two buttons: D and E (with 1 as value). This SwiftUI modifier has three possible options: Ignore, Contain and Combine. With ignore, the HStack is focusable but it will have no attributes, we need to configure them manually. With contain, there are 5 focusable elements, each one of the children. With combine, the HStack is focusable and the attributes are combined from the children. In this case: the label is

You may also find interesting...

It is possible to change the traversing order of accessibility elements by configuring the accessibilityElements array. You should try to avoid it, but one good reason for doing it is if the default order is illogical because of the visual layout.

In SwiftUI you won't find the .notEnabled accessibility trait. Instead, you can just configure a view as such with .disabled(true), and pass false to enable it. VoiceOver will announce it as "dimmed". https://developer.apple.com/documentation/swiftui/view/disabled(_:)

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.

Created in Swift with Ignite.

Supporting Swift for Swifts