aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/View/SwitchCell.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-02-03 12:37:57 +0530
committerRoopesh Chander <roop@roopc.net>2019-02-03 12:40:19 +0530
commit618d89941a68892ad8b1f6a611d7b813452253b0 (patch)
tree1ccd872308f0e86273f034251979b8f1a2193340 /WireGuard/WireGuard/UI/iOS/View/SwitchCell.swift
parentiOS: KeyValueCell should hold the observation token (diff)
downloadwireguard-apple-618d89941a68892ad8b1f6a611d7b813452253b0.tar.xz
wireguard-apple-618d89941a68892ad8b1f6a611d7b813452253b0.zip
iOS: SwitchCell should hold the observation token
And should nil the token when preparing for reuse. This also reverts "iOS: Tunnel detail: Refactor updation of status" Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/iOS/View/SwitchCell.swift3
1 files changed, 3 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/View/SwitchCell.swift b/WireGuard/WireGuard/UI/iOS/View/SwitchCell.swift
index 758083f..6169593 100644
--- a/WireGuard/WireGuard/UI/iOS/View/SwitchCell.swift
+++ b/WireGuard/WireGuard/UI/iOS/View/SwitchCell.swift
@@ -22,6 +22,8 @@ class SwitchCell: UITableViewCell {
var onSwitchToggled: ((Bool) -> Void)?
+ var observationToken: AnyObject?
+
let switchView = UISwitch()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
@@ -45,5 +47,6 @@ class SwitchCell: UITableViewCell {
isEnabled = true
message = ""
isOn = false
+ observationToken = nil
}
}