App通过face id和touch id认证后instantiateViewController问题
instantiateViewController problem after the app passes the face id and the touch id authentication
我在我的页面中添加了一个 "touch id or face id" 按钮。我为此按钮创建了一个动作:btnTouchIdOrFaceIdIsPressed
。问题 1:点击 touch id or face
id 按钮后,在应用程序屏幕中没有打开 HomePageViewController
。为什么?
@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也可以回复一下吗?
Question1: It does not open the HomePageViewController in the app
screen after I click on touch id or face id button. Why?
你可以检查一下你的navigationController是不是nil
print(navigationController ?? "NavigationController is nil")
Question2: Can you write an explanation for this scope? Touch id or face is authentication is failed, right?
Touch ID 或 Face ID 认证失败
Question3: Can you write an explanation for this scope? "device does not support face id or touch id", right?
Touch ID 或 FaceID 认证不可用,可能是用户没有设置
我在我的页面中添加了一个 "touch id or face id" 按钮。我为此按钮创建了一个动作:btnTouchIdOrFaceIdIsPressed
。问题 1:点击 touch id or face
id 按钮后,在应用程序屏幕中没有打开 HomePageViewController
。为什么?
@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也可以回复一下吗?
Question1: It does not open the HomePageViewController in the app screen after I click on touch id or face id button. Why?
你可以检查一下你的navigationController是不是nil
print(navigationController ?? "NavigationController is nil")
Question2: Can you write an explanation for this scope? Touch id or face is authentication is failed, right?
Touch ID 或 Face ID 认证失败
Question3: Can you write an explanation for this scope? "device does not support face id or touch id", right?
Touch ID 或 FaceID 认证不可用,可能是用户没有设置