i want to retrive data from firebase. i was created a structure for user. but i am getting error in init method
Type 'Any' has no subscript members
struct userObj {
var address:String!
var name: String!
var userId: String!
var ref: DatabaseReference?
var key: String!
init(snapshot: DataSnapshot) {
key = snapshot.key
name = snapshot.value!["name"] as! String // this line give error
address = snapshot.value!["address"] as! String // this line give error
userId = snapshot.value!["userId"] as! String // this line give error
ref = snapshot.ref
}
}