<!--
{
  "availability" : [
    "macOS: 10.13.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSAccessibilityCustomAction",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSAccessibilityCustomAction"
  },
  "title" : "NSAccessibilityCustomAction"
}
-->

# NSAccessibilityCustomAction

A custom action to perform on an accessible object.

```
class NSAccessibilityCustomAction
```

## Overview

Apps that support custom actions can create instances of this class, specifying the user-readable name of the action, and either a handler closure or the object and selector to use when performing the action. Assistive apps display custom actions in response to specific user cues. For example, VoiceOver lets users access actions quickly using the Actions rotor.

After creating an instance of this class, add it to the [`accessibilityCustomActions`](/documentation/AppKit/NSAccessibility-c.protocol/accessibilityCustomActions) property of an appropriate accessible object.

## Topics

### Creating a Custom Action

[`-  initWithName:handler:`](/documentation/AppKit/NSAccessibilityCustomAction/init(name:handler:))

Creates a custom action object with the specified name and handler.

[`-  initWithName:target:selector:`](/documentation/AppKit/NSAccessibilityCustomAction/init(name:target:selector:))

Creates a custom action object with the specified name, target, and selector.

### Getting the Action Name

[`name`](/documentation/AppKit/NSAccessibilityCustomAction/name)

A localized name that describes the action.

### Getting the Action

[`handler`](/documentation/AppKit/NSAccessibilityCustomAction/handler)

The closure that handles the execution of the action.

[`target`](/documentation/AppKit/NSAccessibilityCustomAction/target)

The object that performs the action through a selector.

[`selector`](/documentation/AppKit/NSAccessibilityCustomAction/selector)

The method to call on the target to perform the action.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)