title: tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) function not being called when trying to retrieve data from Firebase
body: <p>I'm new to Stack Overflow so please be gentle!</p>
  
  <p>I'm designing an app that retrieves objects from firebase and displays them in fire base.</p>
  
  <p>I configure firebase here:</p>
  
  <pre><code>func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
      FIRApp.configure()
      FIRDatabase.database().persistenceEnabled = true
      // Override point for customization after application launch.
      return true
  }
  </code></pre>
  
  <p>However, I'm finding when I run the app, I just get a blank white screen. After some debugging, I realised it's because the TableView (cellForRowAt indexPath: IndexPath) block of code isn't being reached:</p>
  
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  let cell = tableView.dequeueReusableCell(withIdentifier: "ItemCell", for: indexPath)
  let BUCSItem = items[indexPath.row]
     cell.textLabel?.text = BUCSItem.name
          print("should show bucs")
          return cell    
     }
  </code></pre>
  
  <p>I have the other required tableView method:</p>
  
  <pre><code>func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return items.count
  }
  </code></pre>
  
  <p>Here is my viewDidLoad:</p>
  
  <pre><code>override func viewDidLoad() {   
      super.viewDidLoad()
  
      let ref = FIRDatabase.database().reference(withPath: "BUCS-items")
      tableView.allowsMultipleSelectionDuringEditing = false
  
      ref.queryOrdered(byChild: "BUCSgoals").observe(.value, with: { snapshot in
          var newItems: [BUCSItem] = []
          for child in snapshot.children {
              if let snapshot = child as? FIRDataSnapshot,
                  let BUCSItem = BUCSItem(snapshot: snapshot) {
                  newItems.append(BUCSItem)
              }
          }
          self.items = newItems
  
          self.tableView.reloadData()
      })
  
  }
  </code></pre>
  
  <p>But heres the weird part. When I disconnect form the internet, it works perfectly fine, and the items appear in the table as they're meant to. It's only when connected to the internet that they don't display.</p>
  
  <p>Here's what it looks like when disconnected:
  When connected its the same, but the names aren't appearing in the table.</p>
  
  <p>Any help would be greatly appreciated!</p>