diff options
author | Roopesh Chander <roop@roopc.net> | 2019-02-03 12:37:57 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2019-02-03 12:40:19 +0530 |
commit | 618d89941a68892ad8b1f6a611d7b813452253b0 (patch) | |
tree | 1ccd872308f0e86273f034251979b8f1a2193340 /WireGuard/WireGuard/UI/iOS/View/SwitchCell.swift | |
parent | iOS: KeyValueCell should hold the observation token (diff) | |
download | wireguard-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 'WireGuard/WireGuard/UI/iOS/View/SwitchCell.swift')
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/View/SwitchCell.swift | 3 |
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 } } |