Designing for visionOS & Accessibility

Mar 27 2024 · Swift 5.10, iOS 17, visionOS 1.1, Xcode 15.3

Lesson 03: visionOS Accessibility

Demo: Accessibility Traits & Announcements

Episode complete

Play next episode

Next

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

AcessibilityComponent

Continue with your Vision101 app from the previous video, or open the project in the Demo2-Starter folder.

var accessibilityComponent = AccessibilityComponent()
accessibilityComponent.label = "Plane"
accessibilityComponent.value = "Flying"
accessibilityComponent.isAccessibilityElement = true
accessibilityComponent.traits = [.button, .playsSound]
accessibilityComponent.systemActions = [.activate]
scene.components[AccessibilityComponent.self] = accessibilityComponent

VoiceOver in Apple Vision Pro Simulator

Unlike the iOS simulators, you can turn on VoiceOver in the Apple Vision Pro simulator, but then mouse gestures stop working, so you need a little hack.

Announcements

Back in Xcode, in VolumeView, add an AccessibilityNotification announcement before scene.stopAllAnimations():

AccessibilityNotification.Announcement("Plane stopped flying").post()
See forum comments
Cinema mode Download course materials from Github
Previous: visionOS Accessibility Next: Conclusion