我一直在寻找google,ios论坛,reddit
关于这个错误。但是我似乎找不到任何解决方案。
我一直在关注本教程link
,但出现
错误
AuthDataResultCallback?
我也查看了stackoverflow,并尝试了所有相关内容,但无法摆脱该错误。
//
// ViewController.swift
// transit
//
// Created by transit on 2018/10/26.
// Copyright © 2018 transit. All rights reserved.
//
import UIKit
//importing firebase
import Firebase
class ViewController: UIViewController {
//textfields for email and password
@IBOutlet weak var textFieldEmail: UITextField!
@IBOutlet weak var textFieldPassword: UITextField!
//label for displaying message
@IBOutlet weak var labelMessage: UILabel!
//button for registration
@IBAction func buttonRegister(sender: UIButton){
let email = textFieldEmail.text
let password = textFieldPassword.text
Auth.auth().createUser(withEmail: email!, password: password!, completion: { (user: User, error) in
if error == nil {
self.labelMessage.text = "You are Successfully registered"
}else{
self.labelMessage.text = "Registration Failed. Please Try Again"
}
})
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
//initialising Firebase
FirebaseApp.configure()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}
FIRAuth.auth
更改为Auth.auth
,我做了FIX
。