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


class UITableViewRowAction : NSObject


Create a UITableViewRowAction object to define a single, custom action for a table row. Users swipe horizontally in a table view to reveal the actions associated with a row. Each row-action object contains the text display, the action to perform, and any specific formatting to apply to that action.

To add custom actions to your table view’s rows, implement the tableView(_:editActionsForRowAt:) method in your table view’s delegate object. In that method, create and return the actions for the indicated row. The table displays your action buttons and executes the appropriate handler block when the user taps one of them.


Creating a Table Row Action

Configuring the Action’s Appearance

var style: UITableViewRowAction.Style

The style applied to the action button.

enum UITableViewRowAction.Style

Constants that specify the appearance of action buttons.

var title: String?

The title of the action button.

var backgroundColor: UIColor?

The background color of the action button.

var backgroundEffect: UIVisualEffect?

The visual effect to apply to the button.


Inherits From

See Also

Row Actions

class UISwipeActionsConfiguration

The set of actions to perform when swiping on rows of a table.

class UIContextualAction

An action to display when the user swipes a table row.