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

Looking at how to implement the magic tap in SwiftUI? There is an accessibilityAction(_:_:) with an action kind parameter, you can pass .magicTap, and a closure to handle that action. A reminder of what the magic tap is: https://x.com/dadederk/status/1548791545800888322?s=20&t=ZakzzXNfLk0-2kpYqD5v3A

The .accessibilityElement(children: ) modifier with the .ignore argument does a similar thing to set the container view to be an accessibility element in UIKit. It is the default argument, so you can just say .accessibilityElement(). Because of this, you'll need to use other modifiers to make it accessible and manually configure an accessibility label and value, traits... when necessary. https://developer.apple.com/documentation/swiftui/view/accessibilityelement(children:) https://developer.apple.com/documentation/swiftui/accessibilitychildbehavior/ignore

Check isReduceTransparencyEnabled to lower transparency. A great example is Spotlight. Not only transparency is removed but it keeps the main color of the background, it feels personalized and contextual but reduces noise and improves contrast.

Created in Swift with Ignite.

Supporting Swift for Swifts