Firebase References undeclared

EDIT: I found the real problem behind. Firebase had update. User need to update the firebase version via cocopod. After update the cocopod, can use everything normally same as firebase Doc.

==========================================

I have the same problem, but cannot fix it by updating the pod-file.

Finally, I find out a solution.

Google teach us to import only

import Firebase

Just add:

import FirebaseDatabase

and everything will become fine


In your Podfile, add pod

pod 'Firebase/Database'

Then import Firebase Database in your ViewController

import FirebaseDatabase

Create a globle var ref that you can use it anywhere in viewcontroller

var ref: DatabaseReference!

Now, In viewDidLoad Define the ref

ref = Database.database().reference()

Just had the same problem, but after a while I realized that I was missing an entry in the pod-file, your pod-file should contain:

pod 'Firebase/Database'

Hope it works now :)