aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/CopyableLabelTableViewCell.swift
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-10-31 16:38:05 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-10-31 16:38:05 +0100
commitfff1a70ab9cad053a39d787d70609528a78d3cfa (patch)
tree6f168ae7d8ef4f706c48386b2a61406e3b7fcb38 /WireGuard/WireGuard/UI/iOS/CopyableLabelTableViewCell.swift
parentTunnelManager: bound recursion in startActivation (diff)
downloadwireguard-apple-fff1a70ab9cad053a39d787d70609528a78d3cfa.tar.xz
wireguard-apple-fff1a70ab9cad053a39d787d70609528a78d3cfa.zip
UI: not all subclasses of CopyableLabelTableViewCell have a detailTextLabel, so generalize
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/iOS/CopyableLabelTableViewCell.swift6
1 files changed, 5 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/CopyableLabelTableViewCell.swift b/WireGuard/WireGuard/UI/iOS/CopyableLabelTableViewCell.swift
index 779fe8f..ffe8d6f 100644
--- a/WireGuard/WireGuard/UI/iOS/CopyableLabelTableViewCell.swift
+++ b/WireGuard/WireGuard/UI/iOS/CopyableLabelTableViewCell.swift
@@ -6,6 +6,10 @@ import UIKit
class CopyableLabelTableViewCell: UITableViewCell {
var copyableGesture = true
+ var textToCopy: String? {
+ fatalError("textToCopy must be implemented by subclass")
+ }
+
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@@ -41,7 +45,7 @@ class CopyableLabelTableViewCell: UITableViewCell {
}
override func copy(_ sender: Any?) {
- UIPasteboard.general.string = self.detailTextLabel?.text
+ UIPasteboard.general.string = textToCopy
}
override func prepareForReuse() {