Search code examples
iosobjective-caccessibilityvoiceover

How can I add to the iOS VoiceOver rotor for a custom view?


Recently, I've been working to get my application functioning well with VoiceOver. Generally it's been simple and straightforward, but there are some behaviors from system apps that I'd like to emulate, and I'm having a hard time locating the API to set things up.

In particular, I'm interested in adding a couple of options to the VoiceOver "rotor" and responding to them when the user increases and decreases the value. However, despite the fact that apps like Apple's Maps app add items to the rotor and are able to respond, I can't figure out how to do so for my app.

Has anyone succeeded in doing this? And if so, how?


Solution

  • UPDATE: iOS 10 finally adds ability to add custom rotor items to VoiceOver (not the same thing as the "Actions" rotor item) - just add array of UIAccessibilityCustomRotor objects to accessibilityCustomRotors of the appropriate container view.

    OLD ANSWER:

    There is currently no API to add your own rotor items. You can only implement how some of the existing rotor items work:

    1. "Adjust value" - here you should return UIAccessibilityTraitAdjustable trait for accessibilityTraits and then implement the accessibilityIncrement/accessibilityDecrement methods
    2. "Headings" - you mark some views as UIAccessibilityTraitHeader, then those should be the view the user moves through when the user rotates to "Headings" and flicks up/down
    3. OLD UPDATE: "Actions" - see UIAccessibilityCustomAction

    I guess you should file a radar if you need to add custom items to rotor.