Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIAccessibilityAnnouncementDidFinishNotification not Firing when Swiping to another element

I am using UIAccessibilityPostNotification and UIAccessibilityAnnouncementDidFinishNotification in my app. According to this link, the notification should be posted either when the announcement finishes successfully or it does not (i.e. the user swipes to another element on the screen).

UIAccessibilityAnnouncementDidFinishNotification expects an NSNotification dictionary as a parameter from which you can determine the value spoken and whether or not the speaking has completed uninterrupted. Speaking may become interrupted if the VoiceOver user performs the stop speech gesture or swipes to another element before the announcement finishes.

It works fine if the announcement finishes, but if I swipe or tap the screen before it finishes, no notification is posted. Any thoughts on why this might be? Could it be a bug? If so, any suggestions on workarounds? I have text coming in that needs to be read sequentially so am using this to synchronize. Even if I could somehow reset my speaking flag to 0 when the user taps the screen/does anything, that would be great.

like image 525
Mike F Avatar asked Nov 02 '22 23:11

Mike F


1 Answers

Create a custom view and that custom view needs to implement the protocol UIAccessibilityFocus

- (void)accessibilityElementDidBecomeFocused
- (void)accessibilityElementDidLoseFocus
- (BOOL)accessibilityElementIsFocused
like image 179
user1046037 Avatar answered Nov 15 '22 06:11

user1046037