Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there some kind of UIAccessibility Alert Tone?

Is there any way to get iOS to play the tone that UIActionSheet plays when presented? It’s a sudden beep followed by the word "Alert".

I've searched the documentation and haven't been able to find anything that looks appropriate.

like image 436
Matthew Bischoff Avatar asked Feb 03 '14 21:02

Matthew Bischoff


Video Answer


1 Answers

Not all behaviors of system controls can be reimplemented exactly using the UIAccessibility protocol. There is no public API to issue an accessibility hint tone like that. What you can do, however, is describe the control and transition in such a way that VoiceOver and other assistive clients know to alert the user.

Depending on how your app is implemented, you might need to notify UIAccessibility that screen content has changed using UIAccessibilityPostNotification(), which accepts two parameters: the notification type and object. For a screen change notification, the object represents the next element that should receive focus. VoiceOver will process this notification, issue a tone, and move the cursor to the specified element.

In general, you shouldn't be trying to "get UIAccessibility to" do anything at all. The protocol lets you describe the content and state of your app. It's up to each assistive client to translate these descriptions into an alternative interface as it sees fit. VoiceOver is not the only accessibility feature that relies on UIAccessibility! If you ape its behavior in your app, you could confuse VoiceOver users and alienate users of other assistive features such as Switch Control.

Edit: Another answer suggests playing the sound yourself. Once again, I'd strongly recommend against introducing your own sounds for scenarios already covered by VoiceOver. System sound icons convey more than just the context. They also assure users that a particular control is standard and predictable, implementing all expected behaviors. For quick example, does your custom sheet support the two-finger scrub gesture (accessibility escape)? The system sheet does and people will expect it if they hear the sheet sound.

like image 80
Justin Avatar answered Oct 10 '22 07:10

Justin