I am getting this error: "Type 'Any' has no subscript members" when trying to run this block of code:
init(snapshot: FIRDataSnapshot) {
key = snapshot.key
itemRef = snapshot.ref
if let postContent = snapshot.value!["content"] as? String { // error
content = postContent
} else {
content = ""
}
}
I have been searching for an answer and couldn't find one that solved this problem with FireBase. How would I solve this error?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…