, .
Firebase Swift 3, , FIRMutableData, , [String: AnyObject], [String: Any].
The reason is that the answer is actually [String: Dictionary], and the Dictionary is not AnyObject (anyone can represent an instance of any type whatsoever, including function types and optional types. AnyObject can represent an instance of any type of class.) Because the Dictionary is not a class .
For this code to work, you must replace this line of code:
if var post = currentData.value as? [String : AnyObject], let uid = FIRAuth.auth()?.currentUser?.uid {
with this line:
if var post = currentData.value as? [String : Any], let uid = FIRAuth.auth()?.currentUser?.uid {
source
share