Is there some kind of alert alert for UIAccessibility?

Is there a way to get iOS to play the tone that the UIActionSheet plays when it is presented? His sudden signal, followed by the word "Warning."

I searched the documentation and did not find anything suitable.

+6
source share
3 answers

Not all system control actions can be overridden using the UIAccessibility protocol. There is no public API to release this type of accessibility hint. However, you can describe the management and transition in such a way that VoiceOver and other support clients know to alert the user.

Depending on how your application is implemented, you may need to notify UIAccessibility that the contents of the screen have changed using UIAccessibilityPostNotification() , which takes two parameters: notification type and object. To notify of a screen change, the object represents the next element that should receive focus. VoiceOver processes this notification, produces a tone, and moves the cursor to the specified item.

In general, you should not try to β€œget UIAccessibility ” for anything at all. The protocol allows you to describe the content and status of your application. For each assistant, the client must translate these descriptions into an alternative interface, which he considers necessary. VoiceOver is not the only accessibility feature that depends on UIAccessibility! If you mimic your behavior in your application, you can confuse VoiceOver users and push users away from other supporting features, such as Switch Control.

Edit: Another answer involves playing the sound yourself. Once again, I highly recommend not introducing your own sounds for scenarios already covered by VoiceOver. System sound icons convey more than context. They also guarantee users that specific controls are standard and predictable, implementing all expected behaviors. For example, does your personal sheet support a two-finger crossing gesture (escape access)? The system works, and people expect it if they hear the sound of the worksheet.

+2
source

There are many ways to play audio using System Sound Services, AVAudioPlayer, Audio Queuing, and OpenAL. Without external support libraries, the two easiest ways are System Sound Services and AVAudioPlayer.

when you have a click button that you can play, play in delay mode, play time, etc., here is an example for AVAudioPlayer

  NSError *error; AVAudioPlayer *alertSound = [[AVAudioPlayer alloc] initWithContentsOfURL:musicURL error:&error]; [alertSound prepareToPlay]; [alertSound play]; 

Edited by:

 - (BOOL)playAtTime:(NSTimeInterval)time 

The number of seconds to delay playback relative to the current time of the audio device.

https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/Reference/Reference.html#//apple_ref/OCC/instm/AVAudioPlayer/playAtTime:

0
source

I am sure that the sounds you receive come from a notification of a change in screen. This is an availability notice which (from the documentation)

sent by the application when a new view appears that contains the main part of the screen.

When you send a message, if in your application you can pass either the line that will be read, or the element that the focus should go to. When viewing an alert, focus moves to the alert view, so I assume UIKit sends the alert view as the second argument.

To do this for your own kind, you would do something like this:

 UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, yourNewViewThatShouldGetFocus); 
0
source

All Articles