set(value) { textLabel?.text = value }
}
+ var detailMessage: String {
+ get { return detailTextLabel?.text ?? "" }
+ set(value) { detailTextLabel?.text = value }
+ }
+
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
- super.init(style: .default, reuseIdentifier: reuseIdentifier)
+ super.init(style: .value1, reuseIdentifier: reuseIdentifier)
accessoryType = .disclosureIndicator
}
} else {
let cell: ChevronCell = tableView.dequeueReusableCell(for: indexPath)
cell.message = field.localizedUIString
+ cell.detailMessage = onDemandViewModel.ssidOption.localizedUIString
return cell
}
}
extension TunnelEditTableViewController: SSIDOptionEditTableViewControllerDelegate {
func ssidOptionSaved(option: ActivateOnDemandViewModel.OnDemandSSIDOption, ssids: [String]) {
- let validSSIDs = ssids.filter { !$0.isEmpty }
- onDemandViewModel.selectedSSIDs = validSSIDs
- onDemandViewModel.ssidOption = validSSIDs.isEmpty ? .anySSID : option
+ onDemandViewModel.selectedSSIDs = ssids
+ onDemandViewModel.ssidOption = option
+ onDemandViewModel.fixSSIDOption()
+ if let onDemandSection = sections.firstIndex(where: { $0 == .onDemand }) {
+ if let ssidRowIndex = onDemandFields.firstIndex(of: .ssid) {
+ let indexPath = IndexPath(row: ssidRowIndex, section: onDemandSection)
+ tableView.reloadRows(at: [indexPath], with: .none)
+ }
+ }
}
}