openfrog
openfrog

Reputation: 40765

How to control which UIAccessibilityElement receives focus after posting screen change notification?

I have an overlay with accessible elements. When it disappears, I post UIAccessibilityScreenChangedNotification to cause VoiceOver update.

VoiceOver then picks first element of the screen. How can I make it focus on a specific element by default after posting UIAccessibilityScreenChangedNotification?

Upvotes: 1

Views: 1037

Answers (1)

Wain
Wain

Reputation: 119041

When you post the notification you can supply additional information which is either an NSString object that VoiceOver speaks or an accessibility element that VoiceOver moves to.

UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, focusItem);

Upvotes: 3

Related Questions