finish simple "add password function"
This commit is contained in:
parent
cbbb631e08
commit
b954a4dcab
13 changed files with 314 additions and 26 deletions
|
|
@ -11,18 +11,21 @@ import SwiftyUserDefaults
|
|||
|
||||
class PGPKeySettingTableViewController: UITableViewController {
|
||||
|
||||
@IBOutlet weak var pgpKeyURLTextField: UITextField!
|
||||
@IBOutlet weak var pgpPublicKeyURLTextField: UITextField!
|
||||
@IBOutlet weak var pgpPrivateKeyURLTextField: UITextField!
|
||||
@IBOutlet weak var pgpKeyPassphraseTextField: UITextField!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
pgpKeyURLTextField.text = Defaults[.pgpKeyURL]?.absoluteString
|
||||
pgpPublicKeyURLTextField.text = Defaults[.pgpPublicKeyURL]?.absoluteString
|
||||
pgpPrivateKeyURLTextField.text = Defaults[.pgpPrivateKeyURL]?.absoluteString
|
||||
pgpKeyPassphraseTextField.text = Defaults[.pgpKeyPassphrase]
|
||||
}
|
||||
|
||||
override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {
|
||||
if identifier == "savePGPKeySegue" {
|
||||
if URL(string: pgpKeyURLTextField.text!)!.scheme! == "http" {
|
||||
if URL(string: pgpPublicKeyURLTextField.text!)!.scheme! == "http" &&
|
||||
URL(string: pgpPrivateKeyURLTextField.text!)!.scheme! == "http" {
|
||||
let alertMessage = "HTTP connection is not supported."
|
||||
let alert = UIAlertController(title: "Cannot Save Settings", message: alertMessage, preferredStyle: UIAlertControllerStyle.alert)
|
||||
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue