Questions tagged [uiaccessibility]

UIAccessibility is an informal protocol in UIKit that provides accessibility information about user interface elements. This information is used by VoiceOver and other assistive technologies to help users with disabilities interact with your application. All of the standard views and controls in UIKit implement UIAccessibility, so applications are accessible by default.

This tag is for any questions about making iOS apps more accessible to users via the UIAccessibility protocols.

By default, all objects that inherit from UIView adhere to this informal protocol. In fact, for many views with a low level of customization, iOS is clever enough to set the accessibility attributes automatically. For higher levels of customization, though, the following fields can be set manually (from the Apple docs):

  • Label. A short, localized word or phrase that succinctly describes the control or view, but does not identify the element’s type. Examples are “Add” or “Play.”
  • Traits. A combination of one or more individual traits, each of which describes a single aspect of an element’s state, behavior, or usage. For example, an element that behaves like a keyboard key and that is currently selected can be characterized by the combination of the Keyboard Key and Selected traits.
  • Hint. A brief, localized phrase that describes the results of an action on an element. Examples are “Adds a title” or “Opens the shopping list.”
  • Frame. The frame of the element in screen coordinates, which is given by the CGRect structure that specifies an element’s screen location and size.
  • Value. The current value of an element, when the value is not represented by the label. For example, the label for a slider might be “Speed,” but its current value might be “50%.”

When a VoiceOver user taps a view (or a Switch Control user scans over it), that view's properties are read out loud. These properties also help to determine how VoiceOver and Switch Control facilitate user interaction.

For more information, See the official Apple documentation here: Accessibility Programming Guide

546 questions
4
votes
3 answers

VoiceOver accessibility label for Touch ID

I am trying to ensure that the iOS app that I am working on is accessible and am trying to implement VoiceOver to ensure this. One strange thing that I cannot find any help for is when the Touch ID view is displayed (in my case for signing into the…
GarryW
  • 363
  • 3
  • 7
4
votes
1 answer

What happens if I use accessibilityIdentifier and accessibilityLabel on same element

What happens if I use an accessibilityIdentifier and an accessibilityLabel on same element? Will one override the other, will it still be accessible to a disabled user?
mattman88
  • 475
  • 1
  • 8
  • 22
4
votes
2 answers

iOS Accessibility - is there a way to tell when VoiceOver has changed focus?

I'd like to call a method every time a different element is focused while VoiceOver is active. I was hoping there would be some UIAccessibilityNotification for this, but I can't seem to find any. Ultimately, my goal is to add an additional condition…
Taluca
  • 45
  • 2
  • 8
4
votes
2 answers

Override VoiceOver message in UITextField - iOS Accessibilty

I have a UITextField that contains "£24 pm" but I want voiceover to say "£24 per month". By setting: [textView setAccessibilityLabel:@"£24 per month"]; VoiceOver reads out "£24 per month £24 pm". How do I stop the message in the UITextField from…
Royston Yinkore
  • 561
  • 1
  • 8
  • 22
4
votes
1 answer

What makes an element accessible? And why are tap gestures less accessible than UIButtons? How do I fix it?

Brent Simmons wrote in a blog post that tap gesture recognizers, presumably on a UIView, are less accessible than UIButtons. I'm trying to learn my way around making my app accessible, and I was curious if anyone could clarify what makes that less…
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
4
votes
3 answers

Incorrect accessibility order in UICollectionViewCell with viewForSupplementaryElement

I have a UITableViewCell which contains a UICollectionViewCell in each row. This collection view has supplementary views (a header) which appears at the top of the cell. When navigating with VoiceOver enabled the cells are read in the correct order…
daentech
  • 1,125
  • 12
  • 16
4
votes
1 answer

Default UIAccessibilityElement after screen change

Is there any way to decide which element gets focus first? I tried use the second parameter in the following method UIAccessibilityPostNotification( UIAccessibilityLayoutChangedNotification, element ) but with no success.
Joris Weimar
  • 4,783
  • 4
  • 33
  • 53
4
votes
2 answers

UIAccessibilityAnnouncementNotification asynch issue

I noticed that the UIAccessibility post notification method is some kind of asynch call. This sounds to me quite right because you need to ear last events and not those happened yesterday... But see this example: UIAccessibilityPostNotification(…
4
votes
1 answer

How do I trap focus within a modal popup on iOS using the UIAccessibility protocol?

I am launching a custom popup when the user clicks a button on iOS. How do I make sure that the focus stays within the custom popup (for accessibility reasons) when using voiceover on the iPhone? Currently the focus lands on the elements in the…
Ramya
  • 289
  • 6
  • 17
3
votes
2 answers

SwiftUI tvOS custom Button missing accessibility Focused state

TL;DR: Is there any way to have custom button style (custom pressed state) in SwiftUI on tvOS while it is still working correctly with Accessibility Focus API and therefore its hasFocus works in UI tests? Please visit dedicated Github repo for a…
Lukas Kukacka
  • 7,604
  • 2
  • 25
  • 50
3
votes
2 answers

VoiceOver Scrolling In UITableView where both cells and subviews are accessibility elements

A general strategy that I use to treat both an entire UIView as an accessibility element in addition to some of its subviews is to use the UIView's contentView as an accessibility element in place of the UIView itself. E.g., isAccessibilityElement =…
c_booth
  • 2,185
  • 1
  • 13
  • 22
3
votes
1 answer

UIAccessibilityElement `accessibilityCustomActions` not working properly

I have created an instance of UIAccessibilityElement in order to provide a set of custom actions together with some additional information (i.e. accessibilityLabel + accessibilityHint) The problem is that VoiceOver doesn't announce the existence of…
Alexandru Motoc
  • 582
  • 7
  • 14
3
votes
0 answers

How should I group wrapped UIKit components to improve accessibility support?

I have difficulties understanding what is the right way to make a custom UIView accessible on iOS. As a case study, here is a custom UIControl subclass wrapping a UILabel and a UITextField subviews, that I want to test via a UI test. View…
Mick F
  • 7,312
  • 6
  • 51
  • 98
3
votes
0 answers

How to pause VoiceOver when application in foreground and continue when application goes to background

I have application that contain text to speech functionality also with voice recognition. so when I start application VoiceOver and and text to speech both are overwrite my text. is there any way to stop or pause VoiceOver on application launch and…
3
votes
1 answer

UIAccessibility focus with a UITabBarController

How do I set the UIAccessibility focus on the content of the selected tab of a UITabBarController? It's keeps focussing on the selected UITabBarItem. I've tried to set the focus in the UITabBarControllerDelegate: func tabBarController(_…
Rool Paap
  • 1,918
  • 4
  • 32
  • 39