Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get VoiceOver to announce section labels in iOS?

Tags:

ios

voiceover

In the iPhone Weather App, when using VoiceOver, I noticed that tapping into a section for the first time, it will announce the section.

For example, in iOS 9, tapping on any item the middle strip for the first time will announce "Hourly forecasts" before continuing to describe the element you tapped on. Tapping anything else in the strip will not announce "hourly forecasts".

Tapping on anything on the bottom table, will announce "Daily forecasts" before continuing to describe the element you tapped on. Tapping anything else in this table will not prefix with "Daily Forecasts".

Is there a simple API to name sections of your app? Or do you have to do this manually by tracking the voiceover cursor and dynamically changing your label? (Does this even work? Can you change the accessibilityLabel after something is tapped but before it is read?)

like image 731
thealienisreal Avatar asked Jul 20 '16 21:07

thealienisreal


People also ask

How do I add voice gestures to my iPhone?

Three-finger triple tap. If both VoiceOver and Zoom are enabled, use the three-finger quadruple-tap gesture. Double-tap and hold your finger on the screen until you hear three rising tones, then make the gesture. When you lift your finger, VoiceOver gestures resume.

What does the IOS VoiceOver rotor do?

You can use the VoiceOver rotor to change how VoiceOver works. You can adjust the VoiceOver volume or speaking rate, move from one item to the next on the screen, select special input methods such as Braille Screen Input or Handwriting, and more.


1 Answers

There are two approaches I guess:

  1. Subclassing the UITableViewCell and overriding the accessibilityLabel.

    - (NSString *) accessibilityLabel
    {
        NSString* voiceOverString;
        // append section title on voiceOverString and then the elements value
        return voiceOverString;
    }
    
  2. See this link from Apple docs: You can setAccessibilityLabel of the cell from cellForRowAtIndexPath. The example is for the weather app itself.

like image 132
SHN Avatar answered Oct 25 '22 02:10

SHN