update basictableviewcontroller

This commit is contained in:
Bob Sun 2017-02-10 16:44:59 +08:00
parent 24139e932b
commit 2487b23a10
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
7 changed files with 46 additions and 28 deletions

View file

@ -12,14 +12,25 @@ import SVProgressHUD
class PasswordRepositorySettingsTableViewController: BasicStaticTableViewController {
override func viewDidLoad() {
let url = Defaults[.gitRepositoryURL]?.host
tableData = [
[[.type: CellDataType.segue, .title: "Git Server", .link: "showGitServerSettingSegue"],
[.type: CellDataType.segue, .title: "SSH Key", .link: "showSSHKeySettingSegue"],],
[[.style: CellDataStyle.value1, .title: "Git Server", .action: "segue", .link: "showGitServerSettingSegue", .detailText: url ?? ""],
[.title: "SSH Key", .action: "segue", .link: "showSSHKeySettingSegue"],],
]
navigationItemTitle = "Repository"
super.viewDidLoad()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if let url = Defaults[.gitRepositoryURL] {
if let cell = tableView.cellForRow(at: IndexPath(row: 0, section: 0)) {
cell.detailTextLabel!.text = url.host
}
}
}
@IBAction func cancelGitServerSetting(segue: UIStoryboardSegue) {
}