【发布时间】:2020-08-04 13:48:39
【问题描述】:
我正在尝试检查用户之前是否登录过,如果有,则将其发送到主屏幕。正在满足条件(正在执行打印)但未执行 segue。函数调用在 viewDidLoad() 中。
我对登录的用户使用完全相同的 segue 语句,它可以工作。
func checkIfSignedInAlready() {
//check if user has signed in already
if UserDefaults.standard.string(forKey: "appleAuthorizedUserIdKey") != nil {
// move to main view
print("USER HAS SIGNED IN BEFORE")
performSegue(withIdentifier: "LogIn", sender: nil)
}
}
【问题讨论】:
标签: swift authentication