I have a custom UIView subclass that displays text. The text can be in various languages, and I have audio for it. I don't want Voiceover to ever attempt to read the text itself, because I want the users to here my audio. I can set the accessibilityLabel of the element to an empty string, and play my audio in accessibilityElementDidBecomeFocused. However, I'm worried that this will be an issue for some users, because an alternative display wouldn't know how to display the text, the Item Chooser won't show the item, and I'm sure some other issues I haven't thought of.
Basically, I want to be able to give an accessibility element an accessibilityLabel, and have it be an active accessibilityElement, but NOT have VoiceOver read the label on focus.
As far as I know, this is impossible using current APIs. While you can change content when VoiceOver is running, you cannot distinguish how that content will be presented to the user, whether through speech, Braille keyboard, or other means.
Consider filing an enhancement request with Apple.
I asked a similar question in accessibility-dev#lists.apple.com and it was pointed out to me that Voice Over users set their personal playback voice and speed. Replacing it with your own audio will likely have a detrimental effect.
Related
iOS has built-in support for accessibility, for UIButtons it reads the title of the button followed by a hint "double tap to activate" (by default). Sometimes we are required to make a non-UIButton control behaving similar to UIButton in terms of accessibility, so we would set its accessibility trait to button and hardcode "double tap to activate" for accessibilityHint.
I don't like altering system behaviours, and I've seen accessibility users who prefer single tap instead of double tap (there's an option they can set), although I haven't checked if the opt for single tap instead of double tap, does the system hint become "single tap to activiate".
What is the common practice regarding accessibility support for a non-UIButton control that is tappable? Thanks!
I've seen accessibility users who prefer single tap instead of double tap (there's an option they can set)
I'm really curious to know how it's possible using VoiceOver because a single tap with one finger deals with the accessibility focus. In the UIButton documentation, Apple states: π€
VoiceOver speaks the value of the title [...] when a user taps the button once.
Would you mind detailing the way to activate this option you mentioned because I'm really astonished, please? π€
What is the common practice regarding accessibility support for a non-UIButton control that is tappable?
Using a hint is a very good practice to provide useful information to the user but this information mustn't be crucial for using because the accessibility hint may be deactivated in the device settings.π°
Admittedly speaking, this kind of element must be read out in such a way that its goal and its using are clear enough for any user: that's what traits are made for. π
Many traits are well known and give rise to different actions like adjustable values, customed actions and the rotor items using.
Besides, it's also possible to use the accessibilityActivate() method so as to define the purpose of a double-tap with one finger of an accessible element. π€―
The way you want to vocally expose the possible actions on a tappable control depends on the content of your application.
Finally, keep in mind that hardcoding a hint must be understood as a plus information but definitely not as an essential one because it can be deactivated by the user: a conception oriented a11y is very important when building an app. π
I'd like to have my QR code scanning app inform the user when it finds a QR code. For sighted users, this works using a label at the bottom that updates to notify the user. However, a blind user would have to tap on that label again to have it read by Voice Over. I would much prefer it to just read automatically.
The closest I can find to this question is
UIAccessibility - Read all the labels and buttons on the screen from top to down, which wasn't possible. While this doesn't bode well for my app, that was a year ago. Has Apple updated it's UIAccessibility protocol in any way to allow this?
As a last resort I suppose I could play my own mp3 recording if VoiceOver is on.
You can make VoiceOver speak any string any time you want by calling:
UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, NSLocalizedString("QR code has been detected", comment: ""))
Swift 4
UIAccessibility.post(notification: .announcement, argument: "Text")
There is no direct way to tell VoiceOver to speak updates of an element that VoiceOver cursor is not on. This (i.e. speaking the same content "manually") is a feasible workaround.
You can move VoiceOver focus to an element by using the following:
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, elementToFocusOn)
VoiceOver will then parse and read the accessibility properties associated with that element.
Is there any way to make a text field with keyboard (such as Twitter or Whatsapp)?
I tried to find some help from Google but I could not.
Can anyone help me with this issue or at least to direct me where I can find some info?
You can use the built-in UITextField for the text, but I assume your problem is with getting the field to rise with the keyboard when the user selects it.
This is a bit of a tricky problem, but the general solution is to use a UIScrollView and tell the keyboard to scroll when the user selects the field. This is especially important in iOS 8, which introduces custom keyboards; because third party keyboards can be any height, you can no longer hardcode the default keyboard height to scroll to.
Apple describes how to use this approach under "Moving Content That Is Located Under the Keyboard" in their "Text Programming Guide for iOS."
I'm trying to make my app more accessible but I have a problem. Part of my app consists of pieces of advice, each composed of an UIScrollView with long text. (The text is a UIImage I prepared with Photoshop ).
I would like to make it accessible so that the users could listen to all the advice and pause it whenever they want. I thought of using UIAccessibilityLabel but the text is too long.
Thanks in advance for your help.
Let me preface this by saying I am not an iOS developer but am a long time blind iOS user.
There is no way to easily pause the reading of text and resume at the exact same spot that I know of. According to the documentation, I've found accessibilityLabel is meant to provide accessibility information that can be conveyed in under a sentence. An option I can think of would be to test whether VoiceOver is enabled using UIAccessibilityIsVoiceOverRunning. If this is true, you could put your text into a text view, and display that instead of your UIImage.
A textView will allow a VoiceOver user to read the text by character, word, or line, which is the best option available. If VoiceOver isnβt running, your test will return false, the UIImage will be displayed as normal, and the user wonβt see anything different.
I've got a label that's going to change to say something silly like "the sky is now blue" and I'd like to have VoiceOver read that new text aloud without a semi-blind user needing to press on the label.
Is that possible however, to direct VoiceOver to read a specific item when & where I want?
Thanks.
See this answer: iPhone - make VoiceOver announce label text change
In short, you can tell iOS to speak text aloud when in voiceover mode by sending notifications, like:
UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, #"the sky is now blue");
I'm still trying to figure out how to "focus" on a particular UIAccessibilityElement (i.e. make it as if they had tapped it), but I think in your case you could use UIAccessibilityAnnouncementNotification to speak arbitrary text.