在我的iPhone应用程序的主屏幕中,我需要检查用户是否已登录。在我的viewDidAppear()中,我这样检查:overridefuncviewDidAppear(_animated:Bool){ifletuser=FIRAuth.auth()?.currentUser{//userisloggedin}else{//usernotloggedin,sendtohomepageself.performSegue(withIdentifier:"NotLoggedInSegue",sender:self)}}在每个在线示例中,我都看到人们在他们的代码中使用FIRAuth.auth()
我遇到了这个问题,现在已经尝试解决了几天,但似乎我尝试的所有方法都会产生更多错误。我在使用FIRAuth使用此功能创建用户时遇到问题,它告诉我在;之前添加一个,但它没有解决问题。错误图片:funchandleRegistration(){guardletemail=emailTextField.text,letpassword=passTextField.textelse{print("FormisnotValid")return}FIRAuth.auth()?.createUser(withEmail:email,password:password,completion:FIRUse
更新到新的Firebase。创建了一个新的登录VC,一切正常,没有错误。尝试复制这个新教程:https://codelabs.developers.google.com/codelabs/firebase-ios-swift/index.html?index=..%2F..%2Findex#0现在我突然在我的VC中收到错误Useofunresolvedidentifier'FIRAuth'。我已经尝试重新安装pods文件但没有任何运气,似乎有时如果它添加“importFirebase”然后删除它应用程序将编译,似乎没有韵律或原因它有时有效,有时无效:这是我的代码:importUIKit
更新到新的Firebase。创建了一个新的登录VC,一切正常,没有错误。尝试复制这个新教程:https://codelabs.developers.google.com/codelabs/firebase-ios-swift/index.html?index=..%2F..%2Findex#0现在我突然在我的VC中收到错误Useofunresolvedidentifier'FIRAuth'。我已经尝试重新安装pods文件但没有任何运气,似乎有时如果它添加“importFirebase”然后删除它应用程序将编译,似乎没有韵律或原因它有时有效,有时无效:这是我的代码:importUIKit
我正在使用带有初始SignInViewController的Firebase构建一个应用程序,它加载一个登录页面供用户使用电子邮件进行身份验证,这会触发以下方法:@IBActionfuncdidTapSignIn(sender:AnyObject){letemail=emailField.textletpassword=passwordField.textFIRAuth.auth()?.signInWithEmail(email!,password:password!){(user,error)inifleterror=error{print(error.localizedDescri