Copy upload key to clipboard

This commit is contained in:
relikd
2020-09-08 18:35:30 +02:00
parent 6d78aeac7b
commit e6846953b7

View File

@@ -86,6 +86,13 @@ class TVCShareRecording : UITableViewController, UITextViewDelegate, VCEditTextD
} }
} }
override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
if motion == .motionShake, let key = record.uploadkey {
UIPasteboard.general.string = key
banner(.ok, "Copied to clipboard", timeout: 1)
}
}
// MARK: - Table Data Source // MARK: - Table Data Source
@@ -234,8 +241,8 @@ class TVCShareRecording : UITableViewController, UITextViewDelegate, VCEditTextD
// MARK: - Alerts & Banner // MARK: - Alerts & Banner
private func banner(_ style: NotificationBanner.Style, _ msg: String) { private func banner(_ style: NotificationBanner.Style, _ msg: String, timeout: TimeInterval = 3) {
NotificationBanner(msg, style: style).present(in: navigationController!) NotificationBanner(msg, style: style).present(in: navigationController!, hideAfter: timeout)
} }
private func showAlertAvailableSoon(_ urlStr: String, when: Int?) { private func showAlertAvailableSoon(_ urlStr: String, when: Int?) {