---
title: UIContextualAction
framework: uikit
role: symbol
role_heading: Class
path: uikit/uicontextualaction
---

# UIContextualAction

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

## Declaration

```swift
@MainActor class UIContextualAction
```

## Overview

Overview 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.

## Topics

### Creating the contextual action

- [init(style:title:handler:)](uikit/uicontextualaction/init(style:title:handler:).md)

### Configuring the appearance

- [title](uikit/uicontextualaction/title.md)
- [backgroundColor](uikit/uicontextualaction/backgroundcolor.md)
- [image](uikit/uicontextualaction/image.md)

### Getting the configuration details

- [handler](uikit/uicontextualaction/handler-swift.property.md)
- [UIContextualAction.Handler](uikit/uicontextualaction/handler-swift.typealias.md)
- [style](uikit/uicontextualaction/style-swift.property.md)
- [UIContextualAction.Style](uikit/uicontextualaction/style-swift.enum.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)

## See Also

### Row actions

- [UISwipeActionsConfiguration](uikit/uiswipeactionsconfiguration.md)
- [UITableViewRowAction](uikit/uitableviewrowaction.md)
