Grouping elements in SwiftUI is extremely easy! You can use the .accessibility(children: .combine) modifier. And that's it! It merges properties. For example, generating an accessibility label by joining the children's ones, separated by commas.

Stock Analyzer app in the onboarding screen. There is a row, that by default VoiceOver will treat as four different accessibility elements, needing 4 swipes to navigate it. The labels are:

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

With the attribute accessibilitySpeechPunctuation, you can ask VoiceOver to speak any punctuation marks in your attributed accessibility label, if that is what you want. Good for code snippets?

When configuring a largeContentImage or adjustsImageSizeForAccessibilityContentSizeCategory, it is important to use a pdf asset and preserve the vector data so the icons are crisp at any size.

Created in Swift with Ignite.

Supporting Swift for Swifts