Ios 识别faceId时如何导航到其他页面?
单击按钮时,我添加了人脸id识别,如果为true,则需要导航另一页。但不起作用。应用程序崩溃。几分钟后,导航到下一页,返回按钮不起作用Ios 识别faceId时如何导航到其他页面?,ios,swift,face-id,Ios,Swift,Face Id,单击按钮时,我添加了人脸id识别,如果为true,则需要导航另一页。但不起作用。应用程序崩溃。几分钟后,导航到下一页,返回按钮不起作用 @IBAction func myProfile(_ sender: Any) { // self.performSegue(withIdentifier: "MyProfile", sender: nil) let context:LAContext = LAContext() if context.canEv
@IBAction func myProfile(_ sender: Any) {
// self.performSegue(withIdentifier: "MyProfile", sender: nil)
let context:LAContext = LAContext()
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil){
context.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: "Need to access with your finger print", reply: {(wasCorrect, error) in
if wasCorrect{
print("correct")
self.performSegue(withIdentifier: "MyProfile", sender: nil)
}else{
print("incorrect")
}
})
}else{
print("finger print doesn't support touch id")
}
}
错误消息是:
正在从调用的[Animation]+[UIView SetAnimationEnabled:]
背景线程。从后台线程执行任何操作
不支持UIView或子类上的,可能会导致意外的错误
和阴险的行为
evaluatePolicy
的回调在后台队列中运行
DisptachQueue.main.async {
self.performSegue(withIdentifier: "MyProfile", sender: nil)
}