Lot of errors after follow Youtube videos

I want to make a Firebase app. I follow a video. But I got lots of errors. For example, I got ''variable used within its own initial value' in this code

uploadTask.observeStatus(.Progress){ (snapshot) in

And ' 'overide' can only specified on class members' in

    override func viewDidLoad() {

and more errors that did not happen in the Youtube video but in my app. Please help.

Replies

You should show more code. It's difficult to guess without more.


Maybe:

For ''variable used within its own initial value' in this code"

Is uploadTask.observeStatus() {} called within an init ? Then you may be using a var that is not defined yet.


For 'overide' can only specified on class members'

Where is the override declared ?

You may have an extra or missing open curly bracket { or closing }, which causes override func viewDidLoad() to be outside of the class definition.

A missing or extra { that is not balanced by a } can be the cause of many other errors.

You helped me in the 'override' problem. Another one is fixed by myself. Thanks. Other issues are:

Use of unresolved identifier 'FIRStorage'

  let uploadTask = FIRStorage.storage().reference().child(filename).putFile(url, metadata:nil, completion: {(metadata, error) in

I imported the the FirebaseAuth, Firebase, FirebaseDatabase and FirebaseStorage. Please help. Thanks

Doc h ttps://firebase.google.com/docs/storage/ios/create-reference mentions


Storage.storage() and not FIRStorage.storage()


Check if this has changed in the latest version.