Contents

Custom Controls

Support accessibility for custom user interface elements by adopting a role-specific protocol and implementing its methods.

Overview

Role-specific accessibility protocols represent the most common control types found in apps. Adopt a role-specific accessibility protocol if:

  • You’re creating a custom control that’s a subclass of NSView, and you want to modify the control’s behavior beyond what AppKit provides by default.

  • You’re working with a specialized control that doesn’t subclass NSView. See NSAccessibilityElement first.

First, identify the role-specific protocol that best matches your control’s intended behavior. For example, if your control is something that triggers actions when the user clicks it, adopt the NSAccessibilityButton protocol.

After you select an appropriate protocol, adopt that protocol. The compiler may ask you to reimplement some of the NSAccessibilityProtocol protocol’s accessor or action methods. Simply implement these methods, and your control is ready to use.

Topics

Buttons

Value Controls

Groups

Lists

Text

Images and Color

Loading

Dynamic Elements

Layout Elements

Supporting Types

See Also

Custom View Subclasses