4

I noticed that the UIAccessibility post notification method is some kind of asynch call. This sounds to me quite right because you need to ear last events and not those happened yesterday... But see this example:

UIAccessibilityPostNotification( UIAccessibilityAnnouncementNotification, @"String 1");
UIAccessibilityPostNotification( UIAccessibilityAnnouncementNotification, @"String 2");

You can ear only "string 2".

This example is quite simple, you could answer that one can append "string 2" to "string 1" and the problem is solved. But I'm in a situation such that, but I can't append two string.

My question is: is there a method to synchronize notifications?

Another example is the following. Let say that you have a tab-bar app. When you switch to a particular bar I'd like VoiceOver to say specific text. As you probability know, when you select a tab VoiceOver says itself something like "Bar1 bar selected".

So... the VoiceOver announcement cover my own specific text.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Altair Jones
  • 834
  • 1
  • 7
  • 20

2 Answers2

0

For iOS 6.0+ you may use UIAccessibilityAnnouncementDidFinishNotification to synchronize your announcements.

  • Thanks... Unfortunately, when I wrote this question my app was ios5 compatibility only. Since ios6 has been released I upgrade the project and used your method. Cool from Apple, it was very needed! – Altair Jones Nov 08 '12 at 18:09
  • 1
    I am trying to register a handler for `UIAccessibilityAnnouncementDidFinishNotification`, but I can't get it to fire, even though VoiceOver is reading, and I am using iOS 6.1. Any ideas? – abellina Feb 06 '13 at 21:26
  • 1
    I have the same problem. From my testing, it appears the `UIAccessibilityAnnouncementDidFinishNotification` is only sent for announcements you perform manually, by posting a `UIAccessibilityAnnouncementNotification` It is not fired for the usual UI element announcements made automatically from the accessibility attributes. – cidered Apr 03 '13 at 13:32
  • 2
    Unfortunately, this notification is triggered only if you post UIAccessibilityAnnouncementNotification, otherwise you won't be notified after VoiceOver finishes reading. This makes the notification much less useful, because the point is to be able to synchronize all VO announcements. Now I know why there are only few games that are accessible to VO users. – mota Apr 04 '13 at 11:07
  • It's even worse. If the user touches any accessible element while your text is being spoken, you will not even receive the finished notification of your own text! This is definitely a bug in iOS 6.1. – marcelnijman Apr 20 '13 at 15:14
  • @Morta @marcelnijman Implement the protocol `UIAccessibilityFocus`. It has the method `accessibilityElementDidBecomeFocused` – user1046037 Nov 30 '14 at 03:47
  • This is meant to be used to provide the accessibility text at the moment of focus, instead of providing it beforehand. It doesn't solve the problem of synchronization, as was the question of the OP. – marcelnijman Dec 01 '14 at 06:03
  • @marcelnijman, it appears that at least in iOS 9 the notification is fired in that instance with a key in the `userInfo` of `UIAccessibilityAnnouncementKeyWasSuccessful`. But yeah, this appears to only happen with announcements posted manually or by the system and not actually going between visual elements. :( – Mr Rogers May 05 '16 at 17:40
0

Since iOS 11, new attributed accessibility properties have been introduced including a specific accessibilitySpeechQueueAnnouncement key that enables to queue the announcement or to interrupt the current speech.

However, if you send many notifications and that VoiceOver needs to take over (the user flicks to focus a new element for instance), the notifications that weren't vocalized will be removed as soon as the system vocalizes the element's attributes (stackoverflow answer).

In my view, this is currently the best way to synchronize notifications.

And for your second request about tab bars, a new dedicated question could be written...

XLE_22
  • 5,124
  • 3
  • 21
  • 72