---
title: "tableView(_:performAction:forRowAt:withSender:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitableviewdelegate/tableview(_:performaction:forrowat:withsender:)"
---

# tableView(_:performAction:forRowAt:withSender:)

Tells the delegate to perform a copy or paste operation on the content of a given row.

## Declaration

```swift
optional func tableView(_ tableView: UITableView, performAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?)
```

## Parameters

- `tableView`: The table view that is making this request.
- `action`: A selector type identifying the doc://com.apple.uikit/documentation/UIKit/UIResponderStandardEditActions/copy(_:) or doc://com.apple.uikit/documentation/UIKit/UIResponderStandardEditActions/paste(_:) method of the doc://com.apple.uikit/documentation/UIKit/UIResponderStandardEditActions informal protocol.
- `indexPath`: The index path of the row.
- `sender`: The object that initially sent the copy: or paste: message.

## Discussion

Discussion The table view invokes this method for a given action if the user taps Copy or Paste in the editing menu. The delegate can do whatever is appropriate for the action; for example, for a copy, it can extract the relevant cell content for the row at indexPath and write it to the general pasteboard or an application (private) pasteboard. See UIPasteboard for further information.

## See Also

### Responding to row actions

- [tableView(_:leadingSwipeActionsConfigurationForRowAt:)](uikit/uitableviewdelegate/tableview(_:leadingswipeactionsconfigurationforrowat:).md)
- [tableView(_:trailingSwipeActionsConfigurationForRowAt:)](uikit/uitableviewdelegate/tableview(_:trailingswipeactionsconfigurationforrowat:).md)
- [tableView(_:shouldShowMenuForRowAt:)](uikit/uitableviewdelegate/tableview(_:shouldshowmenuforrowat:).md)
- [tableView(_:canPerformAction:forRowAt:withSender:)](uikit/uitableviewdelegate/tableview(_:canperformaction:forrowat:withsender:).md)
- [tableView(_:editActionsForRowAt:)](uikit/uitableviewdelegate/tableview(_:editactionsforrowat:).md)
