title: How to delete Firebase snapshot from array?
body: <p>I have a function that listens for new objects added to the Firebase database, appends those new objects to an array, and then populates a tableView using that array. I can't figure out how to then remove an object from the array once it has been deleted. I think I'm on the right track but I don't know how to "undo" an append.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>func configureDatabase() {
  
      // Listen for new messages in the Firebase database
      let ref = self.rootRef.child("invites").observeEventType(.ChildAdded, withBlock: { (snapshot) -&gt; Void in
  
      self.invites.append(snapshot)
      self.tableView.insertRowsAtIndexPaths([NSIndexPath(forRow: self.invites.count-1, inSection: 0)], withRowAnimation: .Automatic)
      })
  
      //listen for deleted messages in Firebase database
      let ref2 = self.rootRef.child("invites").observeEventType(.ChildRemoved, withBlock: { (snapshot) -&gt; Void in
  
       //remove from invites array and refresh table??
      })
  }
  </code></pre>
  
  <p>Do I have to pass the value from the actual cell in the table?</p>
  
  <pre><code>override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCellWithIdentifier("AlertCell", forIndexPath: indexPath) as! AlertCell
  
          //get user, set cell text
          let inviteDict = invites[indexPath.row].value as! [String : AnyObject]
  }
  </code></pre>