Development Question on Rotors

By Kevin Shaw, 16 February, 2021

Forum
App Development and Programming

Hi,

I'm developing an app which does not require rotor actions throughout the app except for one screen. Currently, my developer has improperly implemented the rotor actions menu, so tapping on a button makes VO say "Actions Available. Swipe up or down for a custom action."

Right now, he has "Activate" and "Escape" set as the actions in the actions rotor, but I want no actions rotor at all. There is nothing to take action on in the app as it will be displaying nested static information.

the one wrinkle is that we are developing in React Native. Happy to look at answers in Swift or Objective C as the dev team can translate.

Options

Comments

By Glenn Marcus on Tuesday, February 23, 2021 - 01:48

I think you are talking about Custom Actions, which are different than a Custom Rotor. Some UIKit controls automatically publish Custom Actions that VO offers to users. In your case, if the Custom Actions are coming from the built-in UIKit control, you can change the accessibility traits on those controls. You can either set the accessibility trait to none, which should override the default behavior of the UIKit control. ex(in swift):

control.accessibilityTraits = .none

Alternatively, a developer can add Custom Actions to any accessible element. ex (in swift). This code would add 2 custom actions. One named "Next Amp" and the other named "Previous amp".

let next = UIAccessibilityCustomAction(
  name: "Next amp", 
  target: self, 
  selector: #selector(nextAmpAction))

let previous = UIAccessibilityCustomAction(
  name: "Previous amp", 
  target: self, 
  selector: #selector(previousAmpAction))

control.accessibilityCustomActions = [next, previous]

If your developer has explicitly added Custom Actions, it is simply a matter of removing the code that registers the Custom Actions. Search for the code for the term "accessibilityCustomActions"

Best, Glenn