What is the Accessibility Trait, "User Interaction Enabled?" (Xcode Interface Builder) - ios

When configuring elements within a view (.xib) for accessibility, we are given several options in the Accessibility Inspector. I understand that selecting options in the Traits section enables the user to "tab" or "swipe" through elements of a certain type when using VoiceOver. However, I'm not sure what effect selecting (or deselecting) the "User Interaction Enabled" option has.
For example, a static label has this trait enabled by default. I've enabled this element for Accessibility, populated the label and hint, and selected the Static Text and Header traits. Aside from reading the text, the user will not need to interact with this element, so I have deselected that option.
I have read Apple's "Accessibility Programming Guide for iOS;" however, I'm not able to find any information regarding this trait.

It's the equivalent of UIAccessibilityTraitNotEnabled.
It's usually used for buttons or UIControls so when they are disabled VoiceOver tells the user that the element is dimmed or disabled.

Apple goes into some detail about it here: Apple Developer

Related

Accessibility: focus on a view

In my application (that has to be accessible for blind user) I have this scenario (its a grammatic exercise)
When I try it on a device turning on VoiceOver, first it focus on the first part of the sentence, so in that case it read "Kesha" and when i swipe right to read the next part it read the second part of the sentence "the contract because...". What I want is to make it also focus on the gray box (that is a UIViewelement) before it read the second part of the sentence, so that the user know where that empty box is in the sentence, but i don't know how to do that.
I alread tried grayBox.accessibilityLabel = "empty box" or grayBox.accessibilityHint = "empty box" but it just don't set the focus on that view and it doesn't speak. I also tried to put an empty UILabel inside the box but I have some issue positioning that in the right order and I don't think it is the right way to do it. Any suggestion?
On the UIView that you want to 'receive focus' you just need to enable accessibility or mark it as an accessible element, An example:
myGreyView.isAccessibilityElement = true
myGreyView.accessibilityLabel = "A grey box"
myGreyView.accessibilityHint = "this is a secretive box. I don't know what it does"
You can also tick a box in the UIView's properties in xcode interface builder "Accessibility Enabled" I think its called. Which also lets you set the label and hint.
For more information see this Apple guide to VoiceOver
In regards to the order of elements being read out. Is the first part and second part different UILabels or one label?
Are you adding these in code or Xib/Storyboard? Depending on the order they are added as subviews can effect the order VoiceOver reads items out.
When adding the 3x UI elements add them in this order below.
UILabel - "Kesha"
UIView - Gray box, "A grey box"
UILabel - "the contract because it was not fair."
If you have added them via Interface builder (Xib/Storyboard) make sure the order is correct in the view hierarchy.
If this fails you could try overriding the method "accessibilityElements" and return an array of the labels and grey view in the order you want them read out.

VoiceOver : is 'accessibilityActivationPoint' really useful?

I tried and understood what could be the purpose of the accessibilityActivationPoint but in vain.
When a focused accessible element is activated, that property should indicate VoiceOver the specific area it's going to activate when a user double-taps the element (Apple reference) : for me, it's always the selected element itself.
I understood the selected element is considered as a block by VoiceOver, whatever the other elements inside. Once a double tap occurs to activate this block, VoiceOver calls accessibilityActivate to know what to perform (Apple reference).
1/. I've written many tests by creating a custom view including a switch control. Whatever the value of accessibilityActivationPoint inside (or outside on another switch control), the value of the switch control never changes. Is it a proper use case or am I totally wrong ?
2/. When we gather many elements inside one accessible element, how is VoiceOver able to activate one of them while they aren't accessible by definition ? Pointing one of them thanks to the accessibilityActivationPoint should work ?
Personally, I couldn't make it work and think that I'm really confusing accessibilityActivationPoint and accessibilityActivate.
Any help would be appreciated, thanks in advance.
Yes, you have the right idea with accessibilityActivate and accessibilityActivationPoint. Note that, in order for it to work, the accessibilityActivationPoint needs to be a point within the Control that you are trying to activate in on-screen coordinates (use the convert function!).
I think the short answer is "yes" to answer your second question, but, just to clear up confusion about when Accessibility Activation Point is useful, I'll go into more detail about it.
By default (aka, the default behavior for AcessibilityActivate()), when any view is activated by VoiceOver, VoiceOver will send a "tap gesture" to the center of the view. The position of this "tap gesture" can be changed by updating the accessibilityActivationPoint attribute on a view. Below, I have an example for how this property can be used.
Let's say you have a blank button (in the image below, the button is the gray box) next to some text:
For the purpose of accessibility, you may want to make the entire view that holds the button and text an Accessibility Element (so that VoiceOver users can easily understand that the button is associated with the text "Worldspace Attest"). In the image below, I am using Accessibility Inspector to show that the view holding both of these elements is an Accessibility Element.
Notice in these images that the button is not in the center of the view, but rather, it is to the right. When you activate this view using VoiceOver, the view will not select the button; instead, it will send a "tap" to the center of the view (which is the same as tapping the text, which does not do anything). In order to select the button, you have to set the view's accessibilityActivationPoint to be the on-screen coordinates of the button:
view.accessibilityActivationPoint = self.convert(button.center, to: UIApplication.shared.windows.first)
This should make it so that this button is usable by a VoiceOver user.
I hope this information clears up any confusion about the Accessibility Activation Point property. The example I used above can be found in this repository in the "Active Control Name" demo.

iOS: UIAccessibility (Voice Over) with checkbox is not working properly

I am using voice over on checkbox.

The issue I am facing here is,
when user selects the checkbox for the first time it says 'checkbox selected' (which is correct as per accessibilityLabel set) but next time when user tries to de-select it says 'checkbox selected, checkbox de-selected' where it should only say 'checkbox de-selected', vice-a-versa.

So what is happening here is that, the previously set accessibilityLabel is not getting cleared up and when user tries to select or de-select it takes the both previous and currently set label.

Note- using custom checkbox, toggling UIButton with selected/de-selected image.
How to solve this conflict? 
If you create your checkbox thanks to a UIButton item, I suggest to :
Untick the button UIAccessibilityTraits.
Provide a clear hint when the checkbox is first selected : "double tap to change the value".
Update your button accessibility label thanks to IBAction when the box is toggled.
However, it's always better to create a UIAccessibilityElement that contains your check box and a label that describes what it refers to ⟹ when you double tap this accessible wrapper with one finger, the checkbox value toggles and your initial problem disappears.
Following these steps will provide an appropriate user experience with no checkbox VoiceOver conflict that you noticed.

iOS accessibility issue

I am facing an issue with accessibility implementation in iOS. I have a custom accessibility message which I want the reader to read. The reader does read the custom message BUT ALONG WITH THE MESSAGE IT ADDS ONE WORD "BUTTON" AT THE END. here is my code below:
self.privateToggleButton.accessibilityLabel = "Private. Double tap to toggle setting."
Any idea what I am missing?
If your item is in fact a button, iOS will automatically read out that it is a button as a hint to the user. If the item has some kind of button-like interaction it is recommended you keep this.
But if you really need to get rid of it, you can do so by updating the item's AccessibilityTraits and removing UIAccessibilityTrait.Button.
(Note my descriptions of the fields and classes are based on Mono, so the actual Swift/Objective C implementation/naming conventions may be different.)
Using a UIButton will cause VoiceOver to default to saying the word "Button" as the accessibility trait. This is useful to visually impaired users who might not necessarily be able to tell that the object they are looking at is a button that accepts user interaction. I recommend that you do not remove this trait because VoiceOver users are usually familiar with hearing the trait following the accessibility label of the object.
However, if you absolutely want to remove the specification of "Button", you can use the following line of code to remove the accessibility trait.
self.privateToggleButton.accessibilityTrait = UIAccessibilityTraitNone
As per the other answers, the .button trait should not be removed, since the control appears to be a toggle and its trait is required to indicate the intent and behaviour of the control to VoiceOver users. Do also ensure that the current state of the button is conveyed.
If you really need to remove a trait, they can be removed from controls using code like this:
self.privateToggleButton.accessibilityTraits.remove(.button)
Also note that the "Double tap to X" text is a hint string that should be applied to the accessibilityHint property and not accessibilityLabel.

iOS. Settings bundle. Custom Child pane

I have added Settings.Bundle to my app. I want to create several Child panes and I need to perform in them customization, like a cell in table view :(UITableViewCellStyleValue1 or any other).
It is possible to do such thing?
In my Root.plist I have specified 'Settings Page Title', but when my app is executed the title is not used.
The last Item(String) from 'Preference Items' is not displayed, why it's like that?
This is how I would like to customize Child Panes ( I mean text & position not color of background):
Is it possible to change fonts,frames of corresponding labels from code?
BTW, how to create preferences as Facebook, twitter, Flickr apps have?

Resources