title: Retrieving data from firebase - Swift
body: <p>I can not retrieve my Firebase data any more. The function checkForUpdates has a problem with observe(.value) .</p>
  
  <p>this is my db:
  <a href="https://i.stack.imgur.com/1OtZm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1OtZm.jpg" alt="enter image description here"></a></p>
  
  <pre><code>var ref: DatabaseReference!        
  
  
      override func viewDidLoad() {
  
          ref = Database.database().reference()
          checkForUpdates()
      }
  
  func checkForUpdates(){
  ref.child("update").observe(.value, with: {(snapshot) in
              let update_var = snapshot.value as! String
              if update_var == "Y"{
                  self.pageListCore = []
                  self.retrieveDataFromCore(update: "Y")
                  self.ref.child("update").setValue("N")
              }
          })
  }
  </code></pre>