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