所以我曾经构建了一个Twitter克隆,您可以在其中通过此功能匿名发布:
@IBAction func postPressed(_ sender: Any) {
if textView.text != "" {
// Create and save a new job
let newJob = Job(text: textView.text)
newJob.save()
}
self.navigationController?.popToRootViewController(animated: true)
}
过去,我添加了聊天功能和电子邮件登录,现在要做的是,如果您单击帖子,则可以立即与帖子的创建者联系到聊天控制器:
我会这样设置segue:
func didTapPost(user: User) {
let chatlogController = ChatLogController(collectionViewLayout: UICollectionViewFlowLayout())
chatlogController.user = user
navigationController?.pushViewController(chatlogController, animated: true)
}
但是我不知道如何从帖子中获取用户信息...那么,您知道我需要添加到postPressed函数中以获取uid的内容吗?