嘗試此我希望配置這將是有幫助的!但它是在迅速
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]? = [:]) -> Bool {
UIApplication.shared.statusBarStyle = .lightContent
FIRApp.configure()
FIRDatabase.database().persistenceEnabled = true
return true
}
之後,你可以這樣使用它!
@IBAction func signUpDidTouch(_ sender: AnyObject)
{
let alert = UIAlertController(title: "Register",message: "Register",preferredStyle: .alert)
let saveAction = UIAlertAction(title: "Save",style: .default) { action in
let emailField = alert.textFields![0]
let passwordField = alert.textFields![1]
FIRAuth.auth()?.createUser(withEmail: emailField.text!, password: passwordField.text!, completion: { (user, error) in
if error == nil{
FIRAuth.auth()?.signIn(withEmail: self.textFieldLoginEmail.text!, password: self.textFieldLoginPassword.text!, completion: nil)
}
})
}
你能解釋一下你準備做什麼嗎? –