Enable copy in "Server network" screen

This commit is contained in:
Davide De Rosa 2021-01-05 00:02:15 +01:00
parent 7b87f4247c
commit cdb79c585b
1 changed files with 13 additions and 0 deletions

View File

@ -276,4 +276,17 @@ extension ServerNetworkViewController {
return cell return cell
} }
override func tableView(_ tableView: UITableView, shouldShowMenuForRowAt indexPath: IndexPath) -> Bool {
return true
}
override func tableView(_ tableView: UITableView, canPerformAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?) -> Bool {
return action == #selector(UIResponderStandardEditActions.copy(_:))
}
override func tableView(_ tableView: UITableView, performAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?) {
let cell = tableView.cellForRow(at: indexPath)
UIPasteboard.general.string = cell?.detailTextLabel?.text
}
} }