0

My accessibility work on my app continues. The next issue I've discovered is that whenever an alertView appears, voice over only reads out the following

  • Alert
  • Alert Title

Even though I believe it's meant to read out the Alert Body as well.

To work around this issue I've had to do the following code

NSString *alertAction = notification.alertAction;
NSString *alertBody = notification.alertBody;

if (UIAccessibilityIsVoiceOverRunning())
{
  // TODO - iOS VoiceOver has a bug where it only reads out the alert action, not the body.. combine everything into one
  // for now so its read out together
  alertAction = [NSString stringWithFormat:@"%@, %@", alertAction, alertBody];
  alertBody = nil;
}

UIAlertController* alertController = [UIAlertController alertControllerWithTitle:alertAction
                                                                         message:alertBody
                                                                  preferredStyle:UIAlertControllerStyleAlert];


[alertController addAction:[UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleCancel
                                                       handler:^(UIAlertAction * action) {

                                                       }]];

[visibleViewController presentViewController:alertController animated:YES completion:nil];

To combine the title and message into one string which I use for the title. Clearing out the message.

This does seem to fix the problem, but it feels a bit clunky and obviously looks a little objectionable with so much text in the bold title font.

Anyone come across this issue, or got any other fixes to avoid having to butcher all my alerts this way?

Cheers

jimbobuk
  • 1,211
  • 12
  • 25
  • What do you mean by "When an alert appears"? Are you trying to get it to read out the entire alert contents when the alert pops up? Or do you mean that the elements within the alert aren't focusable? – MobA11y Jun 11 '15 at 13:46
  • Yes I'd like the entire alert contents to be read out automatically when the alert appears. I believe its mean't to do this. Otherwise it only reads out the title which means that a blind user has to interact to hear the full alert, which is obviously not ideal. I've done as described and when voice over is active i just use the title of the alert. This works ok, but it feels a bit clunky! – jimbobuk Jun 11 '15 at 19:58
  • I'm curious why you believe this is not ideal? THis is the way Apple's alerts behave in their own applications. Sending more information at users than necessary, or coupling items that aren't visually coupled (A heading like object, and a paragraph like object) is what is not ideal. By coupling these objects together as you are attempting, you're actually making your application less accessible. Let the items behave separately, as they appear separately visually. I would, however, recommend marking your alert title as a heading! – MobA11y Jun 11 '15 at 20:14
  • Thanks for your comments. My app is meant to be used as handsfree as possible as the user will be busy at the time doing other things. This is why I wanted my alert message to be read out in entirety. I appreciate what you are saying though and will try it out when i test my app with my blind beta testers. I can perhaps provide this as a user selectable option if its deemed to not work how I expected. This is the first time I've made an app and hence the first time I'm trying to make one accessible. I'm still going through an initial audit and trying to fix the low hanging fruit at the moment – jimbobuk Jun 11 '15 at 20:29
  • Don't use VoiceOver as a hack to support "hands free" non disabled users. That is silly... there are easier ways to do that!!! – MobA11y Jun 12 '15 at 14:21
  • it's a hack to support hands free for disabled users. Whilst I would love to be able to have alerts vocally read out for all users it's not something that seems particularly possible in a clean way. Especially for when the app is potentially backgrounded. But no this is for disabled users. Non-disabled users whilst being occupied can use the app hands free by just looking at the screen. I wanted to give the same ability to glance to Voice Over users. – jimbobuk Jun 12 '15 at 14:45

0 Answers0