Accessibility

Make your app more accessible to users with disabilities.

Topics

First Steps

protocol NSAccessibilityProtocol

The complete list of properties and methods implemented by accessible elements.

protocol NSAccessibilityContainsTransientUI

A set of methods that support accessibility in a UI that changes dynamically—usually in response to mouse-hover events.

AppKit Elements

protocol NSAccessibilityElementProtocol

A role-based protocol that declares the minimum interface required to interact with an accessibility client.

protocol NSAccessibilityButton

A role-based protocol that declares the minimum interface required for an accessibility element to act as a button.

protocol NSAccessibilityCheckBox

A role-based protocol that declares the minimum interface required for an accessibility element to act as a checkbox.

protocol NSAccessibilityImage

A role-based protocol that declares the minimum interface required for an accessibility element to act as an image.

protocol NSAccessibilityList

A role-based protocol that declares the minimum interface required for an accessibility element to act as a list view.

protocol NSAccessibilityNavigableStaticText

A role-based protocol that declares the minimum interface required for an accessibility element to act as navigable static text.

protocol NSAccessibilityOutline

A role-based protocol that declares the minimum interface required for an accessibility element to act as an outline view.

protocol NSAccessibilityProgressIndicator

A role-based protocol that declares the minimum interface required for an accessibility element to act as a progress indicator.

protocol NSAccessibilityRadioButton

A role-based protocol that declares the minimum interface required for an accessibility element to act as a radio button.

protocol NSAccessibilityRow

A role-based protocol that declares the minimum interface required for an accessibility element to act as a row for a table, list, or outline view.

protocol NSAccessibilitySlider

A role-based protocol that declares the minimum interface required for an accessibility element to act as a slider.

protocol NSAccessibilityStaticText

A role-based protocol that declares the minimum interface required for an accessibility element to act as static text.

protocol NSAccessibilityStepper

A role-based protocol that declares the minimum interface required for an accessibility element to act as a stepper.

protocol NSAccessibilitySwitch

A role-based protocol that declares the minimum interface required for an accessibility element to act as a switch.

protocol NSAccessibilityTable

A role-based protocol that declares the minimum interface required for an accessibility element to act as a table view.

Custom Elements

class NSAccessibilityElement

The basic infrastructure required to interact with an accessibility client.

protocol NSAccessibilityGroup

A role-based protocol that declares the minimum interface required to act as a container for other user interface elements.

protocol NSAccessibilityLayoutArea

A role-based protocol that declares the minimum interface required for an accessibility element to act as a layout area.

protocol NSAccessibilityLayoutItem

A role-based protocol that declares the minimum interface required for an accessibility element to act as a layout item.

Convenience Functions

var description: String?

Returns a standard description for an action.

static func post(element: Any, notification: NSAccessibility.Notification)

Sends a notification to any observing assistive applications.

static func post(element: Any, notification: NSAccessibility.Notification, userInfo: [NSAccessibility.NotificationUserInfoKey : Any]?)

Sends a notification and an optional userInfo dictionary to any observing assistive applications.

static func raiseBadArgumentException(Any!, NSAccessibility.Attribute!, Any!)

Raises an error if the parameter is the wrong type or has an illegal value

Deprecated
func description(with: NSAccessibility.Subrole?) -> String?

Returns a standard description for a role and subrole.

static func description(for: Any) -> String?

Returns a standard role description for a user interface element.

static func setMayContainProtectedContent(Bool) -> Bool

Sets whether the app may have protected content.

static func unignoredChildren(from: [Any]) -> [Any]

Returns a list of unignored accessibility objects, descending the hierarchy if necessary.

static func unignoredChildrenForOnlyChild(from: Any) -> [Any]

Returns a list of unignored accessibility objects, descending the hierarchy if necessary.

static func unignoredDescendant(of: Any) -> Any?

Returns an unignored accessibility object, descending the hierarchy if necessary.

static func unignoredAncestor(of: Any) -> Any?

Returns an unignored accessibility object, ascending the hierarchy if necessary.

Deprecated

NSAccessibility

A legacy, informal protocol that is not recommended for active use.

See Also

User Interactions

Mouse, Keyboard, and Trackpad

Handle events related to mouse, keyboard, and trackpad input.

Gestures

Encapsulate your app's event-handling logic in gesture recognizers so that you can reuse that code throughout your app.

Drag and Drop

Support the direct manipulation of your app's content using drag and drop.