title: How better implement UITableView with two "tabs"?
body: <p>Both tables must be in one view controller, switching by segment control for example. Data is infinite, fetched from core data. I see three solutions:</p>
  
  <p>1) create two objects of <code>UITableView</code> and filling them in shared datasource functions; keeping one of tableviews hidden</p>
  
  <p>2) create two view controller containers, embed in main view controller, and perform completely separated data source methods; keeping one of containers hidden</p>
  
  <p>3) use only one table view object, reloading data when needed, providing offset saving</p>
  
  <p>Need your opinions. Which solution will be faster and/or more readable and right?</p>
  
  <p><strong>Update</strong></p>
  
  <p>Let me try to implement third option:</p>
  
  <pre><code>var tableViewOffsets = [Int: CGPoint]()
  
  func segmentValueChanged(sender: UISegmentedControl) {
      tableViewOffsets[tableView.tag] = tableView.contentOffset
      tableView.tag = sender.selectedSegmentIndex
      tableView.reloadData()
      if let savedOffset = tableViewOffsets[tableView.tag] {
          tableView.setContentOffset(savedOffset, animated: false)
      }
  }
  
  func tableView_dataSourceMethodsTemplate(tableView: UITableView, ...) {
      if tableView.tag == 0 {
          //perform data source code for first tab
      } else {
          //perform data source code for second tab
      }
  }
  </code></pre>