【发布时间】:2021-03-14 20:58:00
【问题描述】:
我已经设置了一个 IBAction 按钮,因此一旦选择,就会出现一个包含文本字段的 UIAlertController,允许用户输入他们的电子邮件。输入此电子邮件并选择“提交”后,应向“答案”值发送一封电子邮件,但在测试期间似乎没有发送任何电子邮件。我怎样才能让它正常工作?
@IBAction func forgottenPassword(_ sender: Any) {
let ac = UIAlertController(title: "Your account email", message: nil, preferredStyle: .alert)
ac.addTextField()
let submitAction = UIAlertAction(title: "Submit", style: .default) { [unowned ac] _ in
let answer = ac.textFields![0]
Auth.auth().sendPasswordReset(withEmail: "\(answer)") { error in
}
}
ac.addAction(submitAction)
present(ac, animated: true)
}
【问题讨论】:
标签: ios swift firebase firebase-authentication