improve UI

This commit is contained in:
Bob Sun 2017-02-08 19:18:10 +08:00
parent 76b863f00a
commit af68f15947
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -147,17 +147,24 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
} else { } else {
password = passwordEntities![index] password = passwordEntities![index]
} }
do { UIImpactFeedbackGenerator(style: .medium).impactOccurred()
let generator = UIImpactFeedbackGenerator(style: .medium) SVProgressHUD.setDefaultMaskType(.clear)
let decryptedPassword = try password.decrypt()! SVProgressHUD.setDefaultStyle(.dark)
UIPasteboard.general.string = decryptedPassword.password SVProgressHUD.show(withStatus: "Decrypting")
generator.impactOccurred() DispatchQueue.global(qos: .userInteractive).async {
SVProgressHUD.setDefaultMaskType(.clear) var decryptedPassword: Password?
SVProgressHUD.setDefaultStyle(.dark) do {
SVProgressHUD.showInfo(withStatus: "Password Copied") decryptedPassword = try password.decrypt()!
SVProgressHUD.dismiss(withDelay: 0.6) } catch {
} catch { print(error)
print(error) SVProgressHUD.showError(withStatus: error.localizedDescription)
SVProgressHUD.dismiss(withDelay: 1)
}
DispatchQueue.main.async {
UIPasteboard.general.string = decryptedPassword?.password
SVProgressHUD.showSuccess(withStatus: "Password Copied")
SVProgressHUD.dismiss(withDelay: 0.6)
}
} }
} }