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


class UIContextualAction : NSObject


Create UIContextualAction objects to define the types of actions that can be performed when the user swipes left or right on a table row. Use your actions to initialize a UISwipeActionsConfiguration object in your table view delegate object.


Creating the Contextual Action

init(style: UIContextualAction.Style, title: String?, handler: UIContextualAction.Handler)

Creates a new contextual action with the specified title and handler.

Configuring the Appearance

var title: String?

The title displayed on the action button.

var backgroundColor: UIColor!

The background color of the action button.

var image: UIImage?

The image to display in the action button.

Getting the Configuration Details

var handler: UIContextualAction.Handler

The handler block to execute when the user selects the action.

typealias UIContextualAction.Handler

The handler block to call in response to the selection of an action

var style: UIContextualAction.Style

The style that is applied to the action button.

enum UIContextualAction.Style

Constants indicating the style information that is applied to the action button.


Inherits From

Conforms To

See Also

Row Actions

class UISwipeActionsConfiguration

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

class UITableViewRowAction

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