title: How to reload UITableView without printing data twice?
body: <p>I have a single view of SlackTextViewController which works as a UITableView.  I'm switching between "states" using a public String  allowing it to read 1 set of data in a certain state and another set of data in another state.  The problem is when I switch back and forth to the original state it prints the data 2, 3, 4 times; as many as I go back and forth.  I'm loading the data from a Firebase server and I think it may be a Firebase issue.  Here is my code...</p>
  
  <pre><code>override func viewWillAppear(animated: Bool) {
      super.viewWillAppear(animated)
  
      if chatState == "ALL"
      {
          self.globalChat()
      }else if chatState == "LOCAL"
      {
          self.localChat()
      }
  }
  
  override func viewDidDisappear(animated: Bool) {
      self.messageModels.removeAll()
      tableView.reloadData()
      ref.removeAllObservers()
  }
  
  func chatACTN()
  {
      if chatState == "ALL"
      {
          self.viewWillAppear(true)
  
      }else if chatState == "LOCAL"
      {
          self.viewWillAppear(true)
      }
  }
  
  func globalChat()
  {
      self.messageModels.removeAll()
      tableView.reloadData()
  
      let globalRef = ref.child("messages")
      globalRef.keepSynced(true)
      globalRef.queryLimitedToLast(100).observeEventType(.ChildAdded, withBlock: { (snapshot) -&gt; Void in
          if snapshot.exists()
          {
              let names = snapshot.value!["name"] as! String
              let bodies = snapshot.value!["body"] as! String
              let avatars = snapshot.value!["photo"] as! String
              let time = snapshot.value!["time"] as! Int
  
              let messageModel = MessageModel(name: names, body: bodies, avatar: avatars, date: time)
              self.messageModels.append(messageModel)
              self.messageModels.sortInPlace{ $0.date &gt; $1.date }
          }
          self.tableView.reloadData()
      })
  }
  
  func localChat()
  {
      self.messageModels.removeAll()
      tableView.reloadData()
  
      print("LOCAL")
  }
  </code></pre>