Class

UIContextualAction

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

Overview

Create instances of this class 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.

Topics

Creating the Contextual Action

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

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: UIContextualActionHandler

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

typealias UIContextualActionHandler

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.

Relationships

Inherits From

Conforms To

See Also

Rows

class UITableViewCell

A cell in a table view.

class UISwipeActionsConfiguration

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

Beta
class UITableViewRowAction

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

enum UIContextualAction.Style

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

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software