UIAccessibility

A set of methods that provide accessibility information about views and controls in an app's user interface.

Overview

The UIAccessibility informal protocol provides accessibility information about an application’s user interface elements. Assistive applications, such as VoiceOver, convey this information to users with disabilities to help them use the application.

Standard UIKit controls and views implement the UIAccessibility methods and are therefore accessible to assistive applications by default. This means that if your application uses only standard controls and views, such as UIButton, UISegmented​Control, and UITable​View, you need only supply application-specific details when the default values are incomplete. You can do this by setting these values in Interface Builder or by setting the properties in this informal protocol.

The UIAccessibility informal protocol is also implemented by the UIAccessibility​Element class, which represents custom user interface objects. If you create a completely custom UIView subclass, you might need to create an instance of UIAccessibility​Element to represent it. In this case, you would support all the UIAccessibility properties to correctly set and return the accessibility element’s properties.

Symbols

Determining Accessibility

var is​Accessibility​Element:​ Bool

A Boolean value indicating whether the receiver is an accessibility element that an assistive application can access.

Configuring an Accessibility Element

var accessibility​Activation​Point:​ CGPoint

The activation point for the accessibility element, in screen coordinates.

var accessibility​Elements​Hidden:​ Bool

A Boolean value indicating whether the accessibility elements contained within this accessibility element are hidden.

var accessibility​Frame:​ CGRect

The frame of the accessibility element, in screen coordinates.

var accessibility​Hint:​ String?

A brief description of the result of performing an action on the accessibility element, in a localized string.

var accessibility​Label:​ String?

A succinct label that identifies the accessibility element, in a localized string.

var accessibility​Language:​ String?

The language in which to speak the accessibility element's label, value, and hint.

var accessibility​Path:​ UIBezier​Path?

The path of the element, in screen coordinates.

var accessibility​Traits:​ UIAccessibility​Traits

The combination of accessibility traits that best characterize the accessibility element.

var accessibility​Value:​ String?

The value of the accessibility element, in a localized string.

var accessibility​View​Is​Modal:​ Bool

A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver.

var should​Group​Accessibility​Children:​ Bool

A Boolean value indicating whether VoiceOver should group together the elements that are children of the receiver, regardless of their positions on the screen.

var accessibility​Navigation​Style:​ UIAccessibility​Navigation​Style

The navigation style to apply to the object and its elements.

Constants

UIAccessibility​Traits

A mask that contains the OR combination of the accessibility traits that best characterize an accessibility element.

Accessibility Traits

Accessibility traits that tell an assistive application how an accessibility element behaves or should be treated.

UIAccessibility​Zoom​Type

The types of system zoom that can be in effect.

UIAccessibility​Notifications

A notification that an accessible application can send.

Notification Dictionary Keys

Keys used in the user​Info parameter dictionary of notifications.

Speech Attributes for Attributed Strings

Attributes that you can apply to text in an attributed string to modify how that text is pronounced.

Assistive Technology Identifiers

Identifiers that you can use when pausing and resuming assistive technologies.

UIAccessibility​Navigation​Style

Constants that describe how an object’s elements should be navigated by an assistive technology.

Notifications

There are two types of accessibility notifications: those which your app can post, and those which your app can observe. The observable accessibility notifications are posted by UIKit when something in the app’s environment changes, such as when an accessibility setting is toggled, or when the layout of a screen changes. You post accessibility notifications with UIAccessibility​Post​Notification(_:​_:​) and observe with the default notification center.

var UIAccessibility​Announcement​Notification:​ UIAccessibility​Notifications

Posted by an application when an announcement needs to be conveyed to the assistive technology.

static let UIAccessibility​Announcement​Did​Finish:​ NSNotification.Name

Posted by UIKit when the system has finished reading an announcement.

static let UIAccessibility​Bold​Text​Status​Did​Change:​ NSNotification.Name

Posted by UIKit when the system’s Bold Text setting has changed.

static let UIAccessibility​Closed​Captioning​Status​Did​Change:​ NSNotification.Name

Posted by UIKit when the setting for closed captioning has changed.

static let UIAccessibility​Darker​System​Colors​Status​Did​Change:​ NSNotification.Name

Posted by UIKit when the system’s Darken Colors setting has changed.

static let UIAccessibility​Grayscale​Status​Did​Change:​ NSNotification.Name

Posted by UIKit when the system’s Grayscale setting has changed.

static let UIAccessibility​Invert​Colors​Status​Did​Change:​ NSNotification.Name

Posted by UIKit when the setting for inverted colors has changed.

var UIAccessibility​Layout​Changed​Notification:​ UIAccessibility​Notifications

Posted by an application when the layout of a screen changes, such as when an element appears or disappears.

static let UIAccessibility​Mono​Audio​Status​Did​Change:​ NSNotification.Name

Posted by UIKit when system audio changes from stereo to mono.

var UIAccessibility​Page​Scrolled​Notification:​ UIAccessibility​Notifications

Posted by an application when a scroll action has completed and the accessibility​Scroll(_:​) method has been called.

var UIAccessibility​Pause​Assistive​Technology​Notification:​ UIAccessibility​Notifications

Post this notification when you want to pause an assistive technology’s operations temporarily.

static let UIAccessibility​Reduce​Motion​Status​Did​Change:​ NSNotification.Name

Posted by UIKit when the system’s Reduce Motion setting has changed.

static let UIAccessibility​Reduce​Transparency​Status​Did​Change:​ NSNotification.Name

Posted by UIKit when the system’s Reduce Transparency system setting has changed.

var UIAccessibility​Resume​Assistive​Technology​Notification:​ UIAccessibility​Notifications

Post this notification to resume an assistive technology’s operations temporarily.

var UIAccessibility​Screen​Changed​Notification:​ UIAccessibility​Notifications

Posted by an application when a new view appears that makes up a major portion of the screen.

static let UIAccessibility​Speak​Screen​Status​Did​Change:​ NSNotification.Name

Posted by UIKit when the system’s Speak Screen setting has changed.

static let UIAccessibility​Speak​Selection​Status​Did​Change:​ NSNotification.Name

Posted by UIKit when the system’s Speak Selection setting has changed.

static let UIAccessibility​Switch​Control​Status​Did​Change:​ NSNotification.Name

Posted by UIKit when the system’s Switch Control setting has changed.

let UIAccessibility​Voice​Over​Status​Changed:​ String

Posted by UIKit when VoiceOver starts or stops. This notification does not include a parameter.

See Also