Выделение и копирование текста в UITableViewCell (Swift 5)

Короткая запись, но я подумал, что надо сохранить этот код, потому что я слишком долго искал, как это сделать.

Мне нужно, чтобы при зажатии ячейки появлялась опция копирования текста в ней. Код:

// MARK: - Copy text in a cell
override func tableView(_ tableView: UITableView, canPerformAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?) -> Bool {
    if (action.description == “copy:”) {
        return true
    } else {
        return false
    }
}
override func tableView(_ tableView: UITableView, performAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?) {
    if (action.description == “copy:”) {
        let cell = tableView.cellForRow(at: indexPath)
        UIPasteboard.general.string = cell?.textLabel?.text
    }
}
override func tableView(_ tableView: UITableView, shouldShowMenuForRowAt indexPath: IndexPath) -> Bool {
    return true
}

Выглядит так:

March 4, 2020