title: Swift 3 UITableView not updating after deleting from Firebase
body: <p>I'm trying to delete items from a Firebase database when user swipes to delete on the UITableView.</p>
  
  <p>I'm also using the nifty showActivityIndicator and hideActivityIndicator functions from <a href="https://github.com/erangaeb/dev-notes/blob/master/swift/ViewControllerUtils.swift" rel="nofollow noreferrer">https://github.com/erangaeb/dev-notes/blob/master/swift/ViewControllerUtils.swift</a> in order to easily show and hide the activity indicator.</p>
  
  <p>I can see both the database record as well as the JPG file properly deleted from Firebase when the following code is run.</p>
  
  <p>But the problem is that the activity indicator never disappears from the screen, and the UITableView does not refresh.</p>
  
  <p>In fact, the</p>
  
  <pre><code>print("Stopping activity indicator")
  </code></pre>
  
  <p>and</p>
  
  <pre><code>print("Reloading table view")
  </code></pre>
  
  <p>do not even run.</p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
          if editingStyle == .delete {
              let alert = UIAlertController(title: "Delete Task", message: "Do you want to delete this task?", preferredStyle: .alert)
              let confirmAction = UIAlertAction(title:"OK", style: .default) { action in
                  // Show activity indicator
                  ViewControllerUtils().showActivityIndicator(uiView: self.view)
  
                  // Retrieve Firebase reference to delete
                  let repairItem = self.repairItems[indexPath.row]
                  let storage = Storage.storage()
                  let storageRef = storage.reference()
                  let imageRef = storageRef.child(repairItem.imageRef)
  
                  // Delete the item from Firebase
                  repairItem.ref?.removeValue(completionBlock: {(error, ref) in
                      if let error = error {
                          print("Problem deleting item")
                      } else {
                          print("Item deleted successfully")
                      }
                  })
  
                  // Delete the photo
                  imageRef.delete { error in
                      if let error = error {
                          print("Problem deleting photo")
                      } else {
                          print("Photo deleted successfully")
                      }
                  }
  
                  print("Stopping activity indicator")
                  // Stop the activity indicator
                  ViewControllerUtils().hideActivityIndicator(uiView: self.view)
  
                  print("Reloading table view")
                  // Reloading table view
                  self.tableView.reloadData()
              }
  
              let cancelAction = UIAlertAction(title: "Cancel", style: .default)
  
              alert.addAction(confirmAction)
              alert.addAction(cancelAction)
  
              present(alert, animated: true, completion: nil)
          }
      }
  </code></pre>