Set name and url in Password non-optional
Name and url in Password class shouldn't be optional because we store them in core data as non-optional. This change also help us to avoid man unneccessary unwrap.
This commit is contained in:
parent
5262ca89f7
commit
2abbceb2e9
9 changed files with 60 additions and 39 deletions
|
|
@ -52,7 +52,8 @@ class OTPScannerController: QRScannerController {
|
|||
|
||||
private func presentSaveAlert() {
|
||||
// initialize alert
|
||||
let password = Password(name: "empty", url: nil, plainText: scannedOTP!)
|
||||
// XXX: use Password class for now, we need to come up a better structure to oranize this
|
||||
let password = Password(name: "empty", url: URL(string: ".")!, plainText: scannedOTP!)
|
||||
let (title, content) = password.getOtpStrings()!
|
||||
let alert = UIAlertController(title: "Success", message: "\(title): \(content)", preferredStyle: UIAlertControllerStyle.alert)
|
||||
alert.addAction(UIAlertAction(title: "Save", style: UIAlertActionStyle.default, handler: {[unowned self] (action) -> Void in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue