Dismiss passcode alert after unlock
This commit is contained in:
parent
2c5ef6492e
commit
13537130a0
1 changed files with 7 additions and 4 deletions
|
|
@ -57,15 +57,20 @@ open class PasscodeLockViewController: UIViewController {
|
||||||
|
|
||||||
internal func dismissPasscodeLock(completionHandler: (() -> Void)? = nil) {
|
internal func dismissPasscodeLock(completionHandler: (() -> Void)? = nil) {
|
||||||
// clean up the textfield
|
// clean up the textfield
|
||||||
enterPasscodeAlert.textFields?[0].text = ""
|
DispatchQueue.main.async {
|
||||||
|
self.enterPasscodeAlert.textFields?[0].text = ""
|
||||||
|
self.enterPasscodeAlert.dismiss(animated: false, completion: nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
// pop
|
||||||
if presentingViewController?.presentedViewController == self {
|
if presentingViewController?.presentedViewController == self {
|
||||||
// if presented as modal
|
// if presented as modal
|
||||||
dismiss(animated: true, completion: { [weak self] in
|
dismiss(animated: true, completion: { [weak self] in
|
||||||
self?.dismissCompletionCallback?()
|
self?.dismissCompletionCallback?()
|
||||||
completionHandler?()
|
completionHandler?()
|
||||||
})
|
})
|
||||||
// if pushed in a navigation controller
|
|
||||||
} else {
|
} else {
|
||||||
|
// if pushed in a navigation controller
|
||||||
_ = navigationController?.popViewController(animated: true)
|
_ = navigationController?.popViewController(animated: true)
|
||||||
dismissCompletionCallback?()
|
dismissCompletionCallback?()
|
||||||
completionHandler?()
|
completionHandler?()
|
||||||
|
|
@ -83,8 +88,6 @@ open class PasscodeLockViewController: UIViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
public func authenticate() {
|
public func authenticate() {
|
||||||
print(enterPasscodeAlert.isBeingPresented)
|
|
||||||
|
|
||||||
let myContext = LAContext()
|
let myContext = LAContext()
|
||||||
let myLocalizedReasonString = "Authentication is needed to access Pass."
|
let myLocalizedReasonString = "Authentication is needed to access Pass."
|
||||||
var authError: NSError?
|
var authError: NSError?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue