Firebase References undeclared

前端 未结 6 1119
闹比i
闹比i 2021-02-19 20:38

I created a new Xcode project, added the \'Firebase\' pod to my pod file and installed it, and added the Google-services.plist file and the rest according to the Firebase docume

6条回答
  •  悲&欢浪女
    2021-02-19 21:25

    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()
    

提交回复
热议问题