tableView(_:performAction:forRowAt:withSender:)
Tells the delegate to perform a copy or paste operation on the content of a given row.
Declaration
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 Copy(_:) or Paste(_:) method of the Uiresponderstandardeditactions informal protocol.
- indexPath:
The index path of the row.
- sender:
The object that initially sent the
copy:orpaste:message.
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.