Introduction

Heads up... You're reading this book for free, with parts of this chapter shown beyond this point as scrambled text.

The visionOS platform contains the most extensive list of accessibility features Apple has ever included in the first generation of a product. However, without an Apple Vision Pro device, it’s not easy to check a visionOS app for accessibility. At the time of writing, the Xcode 15.3 beta 3 Accessibility Inspector doesn’t work when the run destination is Apple Vision Pro. You can turn on VoiceOver in the Apple Vision Pro simulator, but this switches off the normal point-and-click interaction! You can’t close Settings or open another app, and the only way to turn off VoiceOver is to Erase All Content and Settings! One work-around is to turn on Dwell control before you turn on VoiceOver. Hovering the cursor over a button activates it, so you can navigate back to the VoiceOver setting to turn it off. You’ll try this out in this lesson.

You’ll also learn how to:

  • Check whether the text in your app looks OK when the user selects a large reading font size.
  • Check the color contrast between text and background.
  • Add accessibility information to RealityKit entities.
  • Add AccessibilityNotification announcements.

The interfaces in visionOS hover in mid-air and must be readable against a variety of backgrounds, so font size and color contrast are especially important. You can check directly in Xcode’s preview canvas that your app’s text responds well to the user’s preferred reading font size. And you can use Xcode’s Accessibility Inspector’s Color Contrast Calculator to check and adjust the contrast ratio between foreground and background colors.

Similar to using the SwiftUI Accessibility API for SwiftUI elements, RealityKit’s AccessibilityComponent lets you customize a RealityKit entity’s label, value, and traits. In addition, you can customize an entity’s actions and content.

The four types of AccessibilityNotification are available on all platforms, but announcements can be particularly useful in visionOS apps where it’s critical to provide information about what items are available and where they are located.

The visionOS Human Interface Guidelines provide additional recommendations specific to this platform.

See forum comments
Download course materials from Github
Previous: SwiftUI Accessibility API Quiz Next: Dynamic Type & Color Contrast