Charlie S
Charlie S

Reputation: 4594

Setting which single object gets read out by Voiceover when a new UIViewController is presented

I'm building an accessible app in Xcode using Swift.

When my app opens a new page and I am using Accessibility Voiceover it plays out loud 'one' item from the page. This presumably announces to visually impaired people that a new page has appeared. The problem I have is on some pages it selects a strange item to play first. Is there a way to stipulate which item I would like played on each separate UIViewController?

Upvotes: 1

Views: 206

Answers (1)

Charlie S
Charlie S

Reputation: 4594

I found that I need to place this in my viewDidAppear method:

UIAccessibility.post(notification: UIAccessibility.Notification.screenChanged,
                argument: self.firstObject);

Full details: https://developer.apple.com/library/archive/featuredarticles/ViewControllerPGforiPhoneOS/SupportingAccessibility.html

Upvotes: 1

Related Questions