Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 当我从另一个视图中退出时,触摸Id自动触发成功_Ios_Swift_Swift3_Touch Id - Fatal编程技术网

Ios 当我从另一个视图中退出时,触摸Id自动触发成功

Ios 当我从另一个视图中退出时,触摸Id自动触发成功,ios,swift,swift3,touch-id,Ios,Swift,Swift3,Touch Id,这个过程是: 1使用触摸id登录的用户 2用户退出(退出退出退出登录) 然后,应用程序autotrigger touch id和成功响应(模拟器中不会出现这种情况)帮助 这是我登录viewcontroller时的侦听器 override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) if authenticationContext.canEvaluatePolicy(.d

这个过程是: 1使用触摸id登录的用户 2用户退出(退出退出退出登录) 然后,应用程序autotrigger touch id和成功响应(模拟器中不会出现这种情况)帮助

这是我登录viewcontroller时的侦听器

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)      

    if authenticationContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) && DataContainerSingleton.sharedDataContainer.fingerPrintEnabled == "SI"{
        self.touchIdListener()
    }


}


因此,解决办法是改变现状

self.dismiss(animated: true, completion: nil)
例如

var storyboard = UIStoryboard()
            let vc : LoginViewController
            if (Constants.IS_IPAD) {
                storyboard = UIStoryboard.init(name: "LoginIpad", bundle: nil)
                vc = storyboard.instantiateViewController(withIdentifier: "ipadViewController") as! LoginViewController
            } else {
                storyboard = UIStoryboard.init(name: "Login", bundle: nil)
                vc = storyboard.instantiateViewController(withIdentifier: "iphoneViewController") as! LoginViewController
            }
            let navigationController = UINavigationController(rootViewController: vc)
            self.present(navigationController, animated: true, completion: nil)
var storyboard = UIStoryboard()
            let vc : LoginViewController
            if (Constants.IS_IPAD) {
                storyboard = UIStoryboard.init(name: "LoginIpad", bundle: nil)
                vc = storyboard.instantiateViewController(withIdentifier: "ipadViewController") as! LoginViewController
            } else {
                storyboard = UIStoryboard.init(name: "Login", bundle: nil)
                vc = storyboard.instantiateViewController(withIdentifier: "iphoneViewController") as! LoginViewController
            }
            let navigationController = UINavigationController(rootViewController: vc)
            self.present(navigationController, animated: true, completion: nil)