我正在迅速工作,并且不断收到错误消息“两个“ uid”之间的连续语句必须以';'”分隔
let uid = Auth.auth().currentUser?.uid
let title = postTextField.text
let content = contentTextField.text
let postObject = {
"uid": uid,
"title": title,
"content": content
}
Database.database().reference().child("posts").childByAutoId().setValue(postObject)
print("Posted to Firebase")
答案 0 :(得分:1)
在声明和初始化字典时不要使用花括号。 使用方括号。
let postObject = [
"uid": uid,
"title": title,
"content": content
]