s/Observervation/Observation/g;
This commit is contained in:
parent
bc253b1aa8
commit
332e684ad0
|
@ -8,12 +8,12 @@ class TunnelListCell: UITableViewCell {
|
||||||
didSet(value) {
|
didSet(value) {
|
||||||
// Bind to the tunnel's name
|
// Bind to the tunnel's name
|
||||||
nameLabel.text = tunnel?.name ?? ""
|
nameLabel.text = tunnel?.name ?? ""
|
||||||
nameObservervationToken = tunnel?.observe(\.name) { [weak self] tunnel, _ in
|
nameObservationToken = tunnel?.observe(\.name) { [weak self] tunnel, _ in
|
||||||
self?.nameLabel.text = tunnel.name
|
self?.nameLabel.text = tunnel.name
|
||||||
}
|
}
|
||||||
// Bind to the tunnel's status
|
// Bind to the tunnel's status
|
||||||
update(from: tunnel?.status)
|
update(from: tunnel?.status)
|
||||||
statusObservervationToken = tunnel?.observe(\.status) { [weak self] tunnel, _ in
|
statusObservationToken = tunnel?.observe(\.status) { [weak self] tunnel, _ in
|
||||||
self?.update(from: tunnel.status)
|
self?.update(from: tunnel.status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,8 @@ class TunnelListCell: UITableViewCell {
|
||||||
|
|
||||||
let statusSwitch = UISwitch()
|
let statusSwitch = UISwitch()
|
||||||
|
|
||||||
private var statusObservervationToken: AnyObject?
|
private var statusObservationToken: AnyObject?
|
||||||
private var nameObservervationToken: AnyObject?
|
private var nameObservationToken: AnyObject?
|
||||||
|
|
||||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
|
|
|
@ -29,8 +29,8 @@ class TunnelDetailTableViewController: UITableViewController {
|
||||||
let tunnel: TunnelContainer
|
let tunnel: TunnelContainer
|
||||||
var tunnelViewModel: TunnelViewModel
|
var tunnelViewModel: TunnelViewModel
|
||||||
private var sections = [Section]()
|
private var sections = [Section]()
|
||||||
private var onDemandStatusObservervationToken: AnyObject?
|
private var onDemandStatusObservationToken: AnyObject?
|
||||||
private var statusObservervationToken: AnyObject?
|
private var statusObservationToken: AnyObject?
|
||||||
|
|
||||||
init(tunnelsManager: TunnelsManager, tunnel: TunnelContainer) {
|
init(tunnelsManager: TunnelsManager, tunnel: TunnelContainer) {
|
||||||
self.tunnelsManager = tunnelsManager
|
self.tunnelsManager = tunnelsManager
|
||||||
|
@ -45,8 +45,8 @@ class TunnelDetailTableViewController: UITableViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
onDemandStatusObservervationToken = nil
|
onDemandStatusObservationToken = nil
|
||||||
statusObservervationToken = nil
|
statusObservationToken = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
|
@ -196,7 +196,7 @@ extension TunnelDetailTableViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
statusUpdate(cell, tunnel.status)
|
statusUpdate(cell, tunnel.status)
|
||||||
statusObservervationToken = tunnel.observe(\.status) { [weak cell] tunnel, _ in
|
statusObservationToken = tunnel.observe(\.status) { [weak cell] tunnel, _ in
|
||||||
guard let cell = cell else { return }
|
guard let cell = cell else { return }
|
||||||
statusUpdate(cell, tunnel.status)
|
statusUpdate(cell, tunnel.status)
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ extension TunnelDetailTableViewController {
|
||||||
let cell: KeyValueCell = tableView.dequeueReusableCell(for: indexPath)
|
let cell: KeyValueCell = tableView.dequeueReusableCell(for: indexPath)
|
||||||
cell.key = "Activate on demand"
|
cell.key = "Activate on demand"
|
||||||
cell.value = TunnelViewModel.activateOnDemandDetailText(for: tunnel.activateOnDemandSetting())
|
cell.value = TunnelViewModel.activateOnDemandDetailText(for: tunnel.activateOnDemandSetting())
|
||||||
onDemandStatusObservervationToken = tunnel.observe(\.isActivateOnDemandEnabled) { [weak cell] tunnel, _ in
|
onDemandStatusObservationToken = tunnel.observe(\.isActivateOnDemandEnabled) { [weak cell] tunnel, _ in
|
||||||
cell?.value = TunnelViewModel.activateOnDemandDetailText(for: tunnel.activateOnDemandSetting())
|
cell?.value = TunnelViewModel.activateOnDemandDetailText(for: tunnel.activateOnDemandSetting())
|
||||||
}
|
}
|
||||||
return cell
|
return cell
|
||||||
|
|
Loading…
Reference in New Issue