Polish code of GitServerSettingTableViewController
This commit is contained in:
parent
972062935c
commit
e4e20b1d6f
1 changed files with 6 additions and 9 deletions
|
|
@ -77,15 +77,12 @@ class GitServerSettingTableViewController: UITableViewController {
|
|||
|
||||
override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {
|
||||
if identifier == "saveGitServerSettingSegue" {
|
||||
if gitRepositoryURLTextField.text == "" || authenticationMethod == nil {
|
||||
var alertMessage = ""
|
||||
if gitRepositoryURLTextField.text == "" {
|
||||
alertMessage = "Git Server is not set. Please set the Git server first."
|
||||
guard let _ = URL(string: gitRepositoryURLTextField.text!) else {
|
||||
Utils.alert(title: "Cannot Save", message: "Git Server is not set.", controller: self, completion: nil)
|
||||
return false
|
||||
}
|
||||
if authenticationMethod == nil {
|
||||
alertMessage = "Authentication method is not set. Please set your authentication method first."
|
||||
}
|
||||
Utils.alert(title: "Cannot Save Settings", message: alertMessage, controller: self, completion: nil)
|
||||
guard authenticationMethod != nil else {
|
||||
Utils.alert(title: "Cannot Save", message: "Authentication method is not set.", controller: self, completion: nil)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue