I have a problem with my first app I've ever wrote. I watched a tutorial on YouTube on how to let users signup with Firebase and choose a profile picture. In the video everything went as it should, but in my project it gives me following bug:
Value of type 'StorageReference' has no member 'put'
I already saw a post on this topic, but I coldnt work with this answer given there (Value of type 'StorageReference' has no member 'put').
Here is my complete code:
let uploadTask = imageRef.put(data!, metadata: nil, completition: { (metadata, error) in
if err != nil{
print(err!.localizedDescription)
}
imageRef.downloadURL(completion: { (url, er) in
if er != nil{
print(er!.localizedDescription)
}
if let url = url {
let userInfo: [String: Any] = ["uid" : user.uid,
"full name" : self.nameField.text!,
"urlToImage" : url.absoluteString]
self.ref.child("users").child(user.uid).setValue(userInfo)
let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController
(withIdentifier: "userVC")
self.present(vc, animated: true, completion: nil)
}
})
})
The error comes in the first line.