title: refresh tableView after deleting cell
body: <p>I have a tableView with data populated from Firebase, when I click a delete button the data is removed from Firebase but it remains on my app and it doesn't remove the data from the tableView until I close the app and reopen it. Here is how I set up the delete function:</p>
  
  <pre><code>func deletePost() {
          let uid = FIRAuth.auth()!.currentUser!.uid
          let storage = FIRStorage.storage().reference(forURL: "gs://gsignme-14416.appspot.com")
          FIRDatabase.database().reference().child("posts").child(uid).observe(.childAdded, with: { (snapshot) in
  
              let indexPath = self.selectedIndex
  
              let post = self.posts[(indexPath?.row)!] as! [String: AnyObject]
              self.key = post["postID"] as? String
  
              self.itemsRef = FIRDatabase.database().reference().child("posts").child(uid).child(self.key!)
  
  
          // Remove the post from the DB
          FIRDatabase.database().reference().child("books").child(self.key!).removeValue { error in
              if error != nil {
                  print("error \(error)")
              }
          }
  
              })
          self.TableView.reloadData()
      }
  </code></pre>
  
  <p>Here are the delegate and datasource:</p>
  
  <pre><code>    func numberOfSections(in tableView: UITableView) -&gt; Int {
              // #warning Incomplete implementation, return the number of sections
              return 1
          }
  
  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
           posts.count
  }
  
      func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         self.selectedIndex = indexPath
          self.didExpandCell()
          if isExpanded &amp;&amp; self.selectedIndex == indexPath{
              print(indexPath)
          } else{
                      }}
  
      func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -&gt; CGFloat {
  
          if isExpanded &amp;&amp; self.selectedIndex == indexPath{
              return 300
          }
                return 126
      }
  
  
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCell(withIdentifier: "Cells", for: indexPath) as! ProfileTableViewCell
  
          //Configure the cell
          let post = self.posts[indexPath.row] as! [String: AnyObject]
          cell.Title.text = post["title"] as? String
          cell.Author.text = post["Author"] as? String
          cell.ISBN10.text = post["ISBN10"] as? String
          return cell
      }
  </code></pre>
  
  <p>I attempted to add a tableview.reloaddata at the end of the function but that doesn't help. What am I doing wrong?</p>