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

# NSTableViewRowAction

A single action to present when the user swipes horizontally on a table row.

```
class NSTableViewRowAction
```

## Overview

In an editable table, performing a horizontal swipe on a row reveals a button to delete the row by default. This class lets you define one or more custom actions to display for a given row in your table. Each instance of this class represents a single action to perform and includes the text, formatting information, and behavior for the corresponding button.

To add custom actions to your table view’s rows, implement the [`tableView(_:rowActionsForRow:edge:)`](/documentation/AppKit/NSTableViewDelegate/tableView(_:rowActionsForRow:edge:)) method in your table view’s delegate object. In that method, create and return an array of actions for the specified row. The table handles the remaining work of displaying the action buttons and executing the appropriate handler block when the user clicks the button.

## Topics

### Creating a Table Row Action

[`init(style:title:handler:)`](/documentation/AppKit/NSTableViewRowAction/init(style:title:handler:))

Creates and returns a new table view row action object.

### Configuring the Action’s Appearance

[`style`](/documentation/AppKit/NSTableViewRowAction/style-swift.property)

The style applied to the action button.

[`title`](/documentation/AppKit/NSTableViewRowAction/title)

The title of the action button.

[`backgroundColor`](/documentation/AppKit/NSTableViewRowAction/backgroundColor)

The background color of the action button.

### Constants

[`NSTableViewRowAction.Style`](/documentation/AppKit/NSTableViewRowAction/Style-swift.enum)

Constants that help define the appearance and behavior of action buttons.

### Instance Properties

[`image`](/documentation/AppKit/NSTableViewRowAction/image)



---

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)