如何在Firebase Firestore中存储alertView的文本?

问题描述

我希望有人可以帮助我将输入到alertView textField中的数据存储到firebase firestore中。我有一个名为“ HelpRequests”的集合,我希望将信息存储在该集合中。以下是警报的代码

@objc func alertTapped(sender:UIButton!){
    let alert = UIAlertController(title: "Report an issue",message: "Please allow 24hour to respond",preferredStyle: .alert)

    alert.addAction(UIAlertAction(title: "Done",style: .default) { (action) in

        if let te = alert.textFields?.first?.text,te.count > 0 {
        }

    })
    alert.addAction(UIAlertAction(title: "Cancel",style: .cancel) { (action) in
        // Respond to user selection of the action.
    })

    alert.addTextField { (textField) in
        textField.placeholder = ""
    }
    self.present(alert,animated: true)
    }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)