If an image does not convey additional information, maybe it's just used to make the UI look more attractive, it makes sense for VoiceOver to skip it. UIKit: set isAccessibilityElement to false. SwiftUI: create a decorative image explicitly.

The photos app in iOS showing a “What’s new in Photos” screen. It has three new features, each one of them preceded of an icon. These icons could be considered decorative. The code shows how you can set isAccessibilityElement to false for an image view in UIKit and how SwiftUI has am explicit constructor with the decorative keyword, so VoiceOver ignores this element.

You may also find interesting...

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.

As with UIKit, in SwiftUI you can also add/remove a11y traits. But because of its declarative nature, you'll have to approach it in a slightly different way. A little nuance, but something that made me scratch my UIKit head when learning SwitUI.

This is my favorite way of testing VoiceOver. Pick a flow in your app. Turn VoiceOver on. Triple tap with three fingers on the screen to enable Screen Curtain. The screen goes off but you can still navigate your device with VoiceOver.

Created in Swift with Ignite.

Supporting Swift for Swifts