Xcode :Use of unresolved identifier 'metadata' : I have this code, but I have a problem, because it writes me Use of unresolved identifier 'metadata', Thanks in advance! I am a beginner in Xcode, so please explain well!
I got this out of in a youtube tutorial, from zero2launch!



    
  
    import UIKit
    import FirebaseDatabase
    import FirebaseAuth
    import FirebaseStorage
    
    
    
    
    class SignUpViewController: UIViewController {
    
        @IBOutlet weak var ProfileImage: UIImageView!
        @IBOutlet weak var UsernameField: UITextField!
        @IBOutlet weak var PasswordField: UITextField!
        @IBOutlet weak var Mailfield: UITextField!
        
        var selectedImage: UIImage?
        
        @IBAction func dismiss_onClick(_ sender: Any) {
            dismiss(animated: true, completion: nil)
        }
        
        override func viewDidLoad() {
            super.viewDidLoad()
            
           
            
            ProfileImage.layer.cornerRadius = 40
            ProfileImage.clipsToBounds = true
            
            let tapGesture = UITapGestureRecognizer(target: self, action: #selector(SignUpViewController.handleSelectProfileImageView))
            ProfileImage.addGestureRecognizer(tapGesture)
            ProfileImage.isUserInteractionEnabled = true
            
            
            
    
           
        }
        
        @objc func handleSelectProfileImageView() {
            let pickerController = UIImagePickerController()
            pickerController.delegate = self
            present(pickerController, animated: true, completion: nil)
            
            
        }
        
        
        @IBAction func SignUpButton(_ sender: Any) {
            Auth.auth().createUser(withEmail: Mailfield.text!, password: PasswordField.text! , completion:{(user: User?, error:Error?) in
                if error != nil {
                    print(error!.localizedDescription)
                    return
                }
               
                let uid = user?.uid
                let storageRef = Storage.storage().reference(forURL: "gs://gibble-2bed4.appspot.com").child("profile_image").child(uid!)
                if let profileImg = self.selectedImage, let imageData = UIImageJPEGRepresentation(profileImg, 0.1){
                    storageRef.putData(imageData, metadata: nil, completion: { (matadata, error) in
                    if error != nil{
                        return
                    }
                    
                    let profileImageUrl = metadata?.downloadURL()?.absoluteString
                    
                    let ref = Database.database().reference()
                    let usersReference = ref.child("users")
                    let newUserReference = usersReference.child(uid!)
                    newUserReference.setValue(["username" : self.UsernameField.text!, "email": self.Mailfield.text!, "profileImageUrl": profileImageUrl])
                    
                    
                })
                    
                }
                
                
                })
                
            
                
            
                
                
               
        }
            
        }
        
     
    
    
    extension SignUpViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
        func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
           print("did Finish picking Media")
            if let image = info["UIImagePickerControllerOriginalImage"] as? UIImage{
                selectedImage = image
                ProfileImage.image = image
                dismiss(animated: true, completion: nil)
                
            }
            print(info)
            
        }
        
        
        
    }


Thanks again...
Hello, I have this code, but I have a problem, because it writes me Use of unresolved identifier 'metadata', Thanks in advance! I am a beginner in Xcode, so please explain well!
I got this out of in a youtube tutorial, from zero2launch!
Hello, I have this code, but I have a problem, because it writes me Use of unresolved identifier 'metadata', Thanks in advance! I am a beginner in Xcode, so please explain well!
I got this out of in a youtube tutorial, from zero2launch!