2019-03-09 07:23:14 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2021-06-17 14:56:46 +00:00
|
|
|
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
|
2019-03-09 07:23:14 +00:00
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
class SSIDOptionDetailTableViewController: UITableViewController {
|
|
|
|
|
|
|
|
let selectedSSIDs: [String]
|
|
|
|
|
|
|
|
init(title: String, ssids: [String]) {
|
|
|
|
selectedSSIDs = ssids
|
|
|
|
super.init(style: .grouped)
|
|
|
|
self.title = title
|
|
|
|
}
|
|
|
|
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
|
|
fatalError("init(coder:) has not been implemented")
|
|
|
|
}
|
|
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
|
super.viewDidLoad()
|
|
|
|
|
|
|
|
tableView.estimatedRowHeight = 44
|
|
|
|
tableView.rowHeight = UITableView.automaticDimension
|
2019-03-10 07:31:59 +00:00
|
|
|
tableView.allowsSelection = false
|
2019-03-09 07:23:14 +00:00
|
|
|
|
|
|
|
tableView.register(TextCell.self)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension SSIDOptionDetailTableViewController {
|
|
|
|
override func numberOfSections(in tableView: UITableView) -> Int {
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
|
|
|
return selectedSSIDs.count
|
|
|
|
}
|
|
|
|
|
|
|
|
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
|
|
|
|
return tr("tunnelOnDemandSectionTitleSelectedSSIDs")
|
|
|
|
}
|
|
|
|
|
|
|
|
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
|
|
|
let cell: TextCell = tableView.dequeueReusableCell(for: indexPath)
|
|
|
|
cell.message = selectedSSIDs[indexPath.row]
|
|
|
|
return cell
|
|
|
|
}
|
|
|
|
}
|