3

I'm trying to make my app more accessible and so far the standard accessibility things like labels and hints are doing wonders. I'm hitting a problem however with dynamically updating content that's displayed in a UITableView.

Each row of the table updates every second or so, but if I try to create each cell's accessibilityLabel at this point then I find that there is a problem with the VoiceOver reading out the selected label keeps interrupting itself as the label contents changes so the system just starts reading the label content from the beginning again (actually an odd quirk shows the voice over sometimes works correctly for the first cell that was selected, but upon selecting a new cell this bug returns).

I've tried to see if there's anyway to try and understand whether VoiceOver is currently active but as far as I can see there is only a notification posted when VoiceOver finishes

UIAccessibilityAnnouncementDidFinishNotification

There's no equivalent notification for when VoiceOver begins. So there's no way for my TableViewController to know that VoiceOver is currently active and that it shouldn't update any accessibilityLabels.

I'd hoped I could at least detect that one of my TableView cells was the selected accessibilityElement using the

accessibilityElementIsFocused

method. However in all my testing I've not been able to see this reliably fire for a custom UITableViewCell.

I also tried implementing the getter for accessibilityLabel for my custom cell hoping this may work, but sadly the same behaviour occurs.

The only solution I'm left with is a user configurable frequency for dynamic content accessibility updates, say 5, 10, 20 seconds... which can block me updating my label until I know that the last changed content would have definitely been read out. Actually even this could be interrupted if the user chose to select a cell at say 8 seconds after the last update, 2 seconds in for a 10 second limit and the label would update causing the voice over to restart.

Has anyone any ideas of how best to handle this dynamic updating content? I'm presuming the tableview cells are complicating matters a little, but in general I just don't understand how apple expects you to handle dynamic content. All it needs to solve this is another notification

UIAccessibilityAnnouncementDidStartNotification

Or even better a method to enquire as to whether VoiceOver is currently active. But I don't seem to be able to find any!

Thanks for your time, would really appreciate any tips on this. Cheers!

jimbobuk
  • 1,211
  • 12
  • 25
  • Turns out that the UIAccessibilityAnnouncementDidFinishNotification notification is only sent for notifications that you manually request yourself. As it stands at the moment it seems like there is no way to know when VoiceOver is starting or stopping for general announcements! – jimbobuk Jun 02 '15 at 21:58
  • Also part of why I was having trouble with my dynamic table not working with the accessibilityElementIsFocused call was due to the way i was updating the table by forcing it to reloadData... this was obviously recycling the cells and losing the focused state. I've changed this to update visible cells only and the IsFocused call now works as expected. Maybe the announcement will work too without interrupting itself. If not, it'll be the fixed frequency announcements solution as the only viable solution! :( – jimbobuk Jun 02 '15 at 22:01

1 Answers1

3

You want to do two things. First you want to take advantage of the "Updates Frequently" trait. This should improve the behavior of the app when the content is on.

An image of the Accessibility section of Interface Builder in XCode

This should help a lot. Then you alse need to provide a way for user to halt the updating content. Independent of whether you do the above, this is an absolute requirement to satisfy WCag 2.0 guideline 2.2.2.

MobA11y
  • 18,425
  • 3
  • 49
  • 76
  • Thanks. I'd not noticed this trait, or the ability to set traits on a prototype cell in the storyboard. I thought i'd have to set traits in code as required. In the end I've fixed this problem for the most part. Should really update with my own answer. Essentially I remove all the built in accessibility labels (setting them to @" " i think. Then I monitor selection of each element and manually trigger my own announcement, this is the only way that it calls back when that announcement has finished. That way i can then wait a defined amount of time till i post the announcement again. Works ok! – jimbobuk Jun 11 '15 at 20:02