add authentication method selection UI
This commit is contained in:
parent
fcef83277f
commit
cc7a53781c
9 changed files with 273 additions and 7 deletions
|
|
@ -26,6 +26,7 @@ class GitServerSettingTableViewController: UITableViewController {
|
|||
}
|
||||
usernameTextField.text = Defaults[.gitRepositoryUsername]
|
||||
passwordTextField.text = Defaults[.gitRepositoryPassword]
|
||||
authenticationTableViewCell.detailTextLabel?.text = Defaults[.gitRepositoryAuthenticationMethod]
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
|
|
@ -37,4 +38,21 @@ class GitServerSettingTableViewController: UITableViewController {
|
|||
super.viewWillDisappear(animated)
|
||||
view.endEditing(true)
|
||||
}
|
||||
@IBAction func save(segue: UIStoryboardSegue) {
|
||||
if let controller = segue.source as? UITableViewController {
|
||||
if controller.tableView.indexPathForSelectedRow == IndexPath(row: 0, section:0) {
|
||||
authenticationTableViewCell.detailTextLabel?.text = "Password"
|
||||
} else {
|
||||
authenticationTableViewCell.detailTextLabel?.text = "SSH Key"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
if segue.identifier == "selectAuthenticationMethod" {
|
||||
if let controller = segue.destination as? GitRepositoryAuthenticationSettingTableViewController {
|
||||
controller.selectedMethod = authenticationTableViewCell.detailTextLabel!.text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue