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

Two instances of the Stock Analyzer app showing you what it is included with the pro version and how much it costs. The first one uses .accessibilityElement(children .combine) to group three elements, and that causes VoiceOver to announce

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

You may also find interesting...

SwiftUI has equivalent accessibility modifiers for some of UIAccessibility's properties in UIKit. Same basic concepts apply. Label: https://developer.apple.com/documentation/swiftui/view/accessibilitylabel(_:)-9ek2h Value: https://developer.apple.com/documentation/swiftui/view/accessibilityvalue(_:)-8esl7 Traits: https://developer.apple.com/documentation/swiftui/view/accessibilityaddtraits(_:) Hint: https://developer.apple.com/documentation/swiftui/view/accessibilityhint(_:)-3i2vu

Creating UIAccessibilityElements, combined with a semanticGroup accessibilityContainerType, can also help you make components as complex as charts accessible. Example from "Bring Accessibility to Charts" WWDC21: https://developer.apple.com/videos/play/wwdc2021/10122/

Toggles or UISwitches are often found separated from the label that precedes (and describes) them; with an unclear label; missing a value, trait, or hint; or even not being actionable at all.

Created in Swift with Ignite.

Supporting Swift for Swifts