Instance Method


Asks the delegate if the editing menu should omit the Copy or Paste command for a given row.


optional func tableView(_ tableView: UITableView, canPerformAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?) -> Bool



The table-view object that is making this request.


A selector type identifying the copy(_:) or paste(_:) method of the UIResponderStandardEditActions informal protocol.


An index-path object locating the row in its section.


The object that initially sent the copy: or paste: message.

Return Value

true if the command corresponding to action should appear in the editing menu, otherwise false. The default value is false.


This method is invoked after tableView(_:shouldShowMenuForRowAt:). It gives the developer the opportunity to exclude one of the commands—Copy or Paste—from the editing menu. For example, the user might have copied some cell content from one row but wants to paste into another row that doesn’t take the copied content. In a case like this, return false from this method.

See Also

Responding to Row Actions

func tableView(UITableView, shouldShowMenuForRowAt: IndexPath) -> Bool

Asks the delegate if the editing menu should be shown for a certain row.

func tableView(UITableView, performAction: Selector, forRowAt: IndexPath, withSender: Any?)

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

func tableView(UITableView, editActionsForRowAt: IndexPath) -> [UITableViewRowAction]?

Asks the delegate for the actions to display in response to a swipe in the specified row.