UIAccessibility

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.

Overview

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, UISegmentedControl, and UITableView, 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 UIAccessibilityElement class, which represents custom user interface objects. If you create a completely custom UIView subclass, you might need to create an instance of UIAccessibilityElement 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 isAccessibilityElement: Bool

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

Configuring an Accessibility Element

var accessibilityActivationPoint: CGPoint

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

var accessibilityElementsHidden: Bool

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

var accessibilityFrame: CGRect

The frame of the accessibility element, in screen coordinates.

var accessibilityHint: String?

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

var accessibilityLabel: String?

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

var accessibilityLanguage: String?

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

var accessibilityPath: UIBezierPath?

The path of the element, in screen coordinates.

var accessibilityTraits: UIAccessibilityTraits

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

var accessibilityValue: String?

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

var accessibilityViewIsModal: Bool

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

var shouldGroupAccessibilityChildren: 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 accessibilityNavigationStyle: UIAccessibilityNavigationStyle

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

Constants

UIAccessibilityTraits

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.

UIAccessibilityZoomType

The types of system zoom that can be in effect.

UIAccessibilityNotifications

A notification that an accessible application can send.

Notification Dictionary Keys

Keys used in the userInfo 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.

UIAccessibilityNavigationStyle

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 UIAccessibilityPostNotification(_:_:) and observe with the default notification center.

var UIAccessibilityAnnouncementNotification: UIAccessibilityNotifications

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

static let UIAccessibilityAnnouncementDidFinish: NSNotification.Name

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

static let UIAccessibilityBoldTextStatusDidChange: NSNotification.Name

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

static let UIAccessibilityClosedCaptioningStatusDidChange: NSNotification.Name

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

static let UIAccessibilityDarkerSystemColorsStatusDidChange: NSNotification.Name

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

static let UIAccessibilityGrayscaleStatusDidChange: NSNotification.Name

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

static let UIAccessibilityGuidedAccessStatusDidChange: NSNotification.Name

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

static let UIAccessibilityInvertColorsStatusDidChange: NSNotification.Name

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

var UIAccessibilityLayoutChangedNotification: UIAccessibilityNotifications

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

static let UIAccessibilityMonoAudioStatusDidChange: NSNotification.Name

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

var UIAccessibilityPageScrolledNotification: UIAccessibilityNotifications

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

var UIAccessibilityPauseAssistiveTechnologyNotification: UIAccessibilityNotifications

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

static let UIAccessibilityReduceMotionStatusDidChange: NSNotification.Name

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

static let UIAccessibilityReduceTransparencyStatusDidChange: NSNotification.Name

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

var UIAccessibilityResumeAssistiveTechnologyNotification: UIAccessibilityNotifications

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

var UIAccessibilityScreenChangedNotification: UIAccessibilityNotifications

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

static let UIAccessibilitySpeakScreenStatusDidChange: NSNotification.Name

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

static let UIAccessibilitySpeakSelectionStatusDidChange: NSNotification.Name

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

static let UIAccessibilitySwitchControlStatusDidChange: NSNotification.Name

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

let UIAccessibilityVoiceOverStatusChanged: String

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