Я добавил кнопку "Touch ID или Face ID" на своей странице.Я создал действие для этой кнопки: btnTouchIdOrFaceIdIsPressed
.Вопрос 1: Он не открывает HomePageViewController
на экране приложения после того, как я нажимаю кнопку touch id or face
id.Почему?
@IBAction func btnTouchIdOrFaceIdIsPressed(_ sender: UIButton) {
self.useBiometricAuthentication()
}
func useBiometricAuthentication () {
let context = LAContext()
var error : NSError?
let reason = "some message for app user for the touch id or face id.."
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: reason) { (success, error) in
if success {
self.callMeAfterSuccessLoginAction()
} else {
//Question2: Can you write an explanation for this scope? Touch id or face is authentication is failed, right?
}
}
} else {
//Question3: Can you write an explanation for this scope? "device does not support face id or touch id", right?
}
}
func callMeAfterSuccessLoginAction() {
DispatchQueue.main.async {
let oHomepageViewController = self.storyboard?.instantiateViewController(withIdentifier: "Homepage") as! HomepageViewController
self.navigationController?.setViewControllers([oHomepageViewController], animated: true)
}
}
Можете ли вы также ответить на вопросы 2 и 3, пожалуйста?