【发布时间】:2019-05-25 17:11:05
【问题描述】:
当点击按钮时,我添加了人脸识别和if true,需要导航另一个页面。但不工作。应用程序崩溃。几分钟后导航到下一页,后退按钮不起作用。
@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 setAnimationsEnabled:] 被调用 后台线程。从后台线程执行任何操作 不支持在 UIView 或子类上,可能会导致意外 和阴险的行为。
【问题讨论】: