小编Mar*_*llo的帖子

"类型'AuthDataResult'的值没有成员'uid'"错误

有人可以帮我解决这个问题吗?第一个错误是"类型'authdataresult'的值没有成员'uid'".

Auth.auth()?.signIn(withEmail: email, password: password, completion:
Run Code Online (Sandbox Code Playgroud)

所以我删除了问号以解决问题并且它有效!但在那之后,另一个错误来了,它说"类型'AuthDataResult'的值没有成员'uid'".我知道,这很烦人.

self.userUid = user.uid
Run Code Online (Sandbox Code Playgroud)

哦,还有另一个错误,它已经在我的项目中很长一段时间所以现在我忽略了它但是如果有人知道如何修复它请告诉我.错误是"只有实例方法可以声明为@ibaction".

@IBAction func signInTapped(_ sender: Any) {
Run Code Online (Sandbox Code Playgroud)

我不知道为什么,但也许3个错误是连接的.我不知道.救命.所以现在我又被卡住了.这是整个混乱编码的东西.

import UIKit
import Firebase

class ViewController: UIViewController {
    @IBOutlet weak var emailField: UITextField!
    @IBOutlet weak var passwordField: UITextField!

    var userUid: String!

    func goToCreateUserVC(){
        performSegue(withIdentifier: "SignUp", sender: nil)
    }

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if segue.identifier == "SignUp" {
            if let destination = segue.destination as? userVC {
                if userUid != nil {
                    destination.userUid = userUid
                }
                if emailField.text != nil …
Run Code Online (Sandbox Code Playgroud)

swift firebase-authentication

9
推荐指数
1
解决办法
4542
查看次数

标签 统计

firebase-authentication ×1

swift ×1