parent
ba0f689acd
commit
f5365a9d6e
|
@ -110,11 +110,19 @@ extension NotificationSettingsViewController: UITableViewDelegate {
|
||||||
|
|
||||||
let entry = sections[indexPath.section].entries[indexPath.row]
|
let entry = sections[indexPath.section].entries[indexPath.row]
|
||||||
|
|
||||||
|
|
||||||
switch entry {
|
switch entry {
|
||||||
case .alert(_):
|
case .alert(let alert):
|
||||||
break
|
|
||||||
case .policy:
|
guard let cell = tableView.cellForRow(at: indexPath) as? NotificationSettingTableViewToggleCell else { return }
|
||||||
delegate?.showPolicyList(self, viewModel: viewModel)
|
|
||||||
|
let newValue = (cell.toggle.isOn == false)
|
||||||
|
cell.toggle.setOn(newValue, animated: true)
|
||||||
|
|
||||||
|
toggleValueChanged(cell, alert: alert, newValue: newValue)
|
||||||
|
|
||||||
|
case .policy:
|
||||||
|
delegate?.showPolicyList(self, viewModel: viewModel)
|
||||||
}
|
}
|
||||||
|
|
||||||
tableView.deselectRow(at: indexPath, animated: true)
|
tableView.deselectRow(at: indexPath, animated: true)
|
||||||
|
|
|
@ -23,7 +23,6 @@ class ToggleTableViewCell: UITableViewCell {
|
||||||
toggle.onTintColor = Asset.Colors.Brand.blurple.color
|
toggle.onTintColor = Asset.Colors.Brand.blurple.color
|
||||||
|
|
||||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
|
|
||||||
|
|
||||||
contentView.addSubview(label)
|
contentView.addSubview(label)
|
||||||
contentView.addSubview(toggle)
|
contentView.addSubview(toggle)
|
||||||
|
|
Loading…
Reference in New Issue