show error alert window when cannot decrypt password
This commit is contained in:
parent
7b00435658
commit
a2bcbe1804
1 changed files with 8 additions and 5 deletions
|
|
@ -80,11 +80,14 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
|
||||||
do {
|
do {
|
||||||
self.password = try self.passwordEntity!.decrypt()!
|
self.password = try self.passwordEntity!.decrypt()!
|
||||||
} catch {
|
} catch {
|
||||||
let alert = UIAlertController(title: "Cannot Show Password", message: error.localizedDescription, preferredStyle: UIAlertControllerStyle.alert)
|
DispatchQueue.main.async {
|
||||||
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: {(UIAlertAction) -> Void in
|
let alert = UIAlertController(title: "Cannot Show Password", message: error.localizedDescription, preferredStyle: UIAlertControllerStyle.alert)
|
||||||
self.navigationController!.popViewController(animated: true)
|
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: {(UIAlertAction) -> Void in
|
||||||
}))
|
self.navigationController!.popViewController(animated: true)
|
||||||
self.present(alert, animated: true, completion: nil)
|
}))
|
||||||
|
self.present(alert, animated: true, completion: nil)
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let password = self.password!
|
let password = self.password!
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue