Show OTP for scanned QR codes before saving

This commit is contained in:
Yishi Lin 2017-04-10 02:15:16 +08:00
parent 4eba8f7800
commit 5be56eca44
4 changed files with 163 additions and 30 deletions

View file

@ -212,9 +212,25 @@ class PasswordEditorTableViewController: UITableViewController, FillPasswordTabl
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "showQRScannerSegue" {
if let viewController = segue.destination as? QRScannerController {
if let navController = segue.destination as? UINavigationController {
if let viewController = navController.topViewController as? QRScannerController {
viewController.delegate = self
}
} else if let viewController = segue.destination as? QRScannerController {
viewController.delegate = self
}
}
}
@IBAction private func cancelOTPScanner(segue: UIStoryboardSegue) {
}
@IBAction func saveScannedOTP(segue: UIStoryboardSegue) {
if let controller = segue.source as? OTPScannerController {
if let scannedOTP = controller.scannedOTP {
insertScannedOTPFields(scannedOTP)
}
}
}
}