title: How to manage 5 different table views (and detail views) from a tab-based view controller in swift?
body: <p>In other words, I'm looking to figure out how to use a 5 tab tab-based view controller, that, when i touch on one tab, I am brought to a table view- static array- that would then have a detail view controller.</p>
  
  <p>So tab- table view- detail view.</p>
  
  <p>I am new at swift so I'm sure how to phrase this properly, but I'm wondering how to manage/add multiple table views to my project using tabs.  I've register for an online iOS swift course, but they only touch upon single-view applications.  Any help or references would be greatly appreciated.</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
  
  @IBOutlet weak var tableView: UITableView!
  
  var taskArray:[TaskModel] = []
  
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
  
  
      let task1 = TaskModel(task: "Study French", subTask: "Verbs", date: "04/14/2014")
      let task2 = TaskModel(task: "Eat Dinner", subTask: "Burgers", date: "01/14/2014")
  
  
      taskArray = [task1, task2, TaskModel(task: "Gym", subTask: "Leg Day", date: "01/14/2014")]
  
      tableView.reloadData()
  
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  
  }
  
  override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
  
      if segue.identifier == "showTaskDetail" {
          let detailVC: TaskDetailViewController = segue.destinationViewController as TaskDetailViewController
          let indexPath =  self.tableView.indexPathForSelectedRow()
          let thisTask = taskArray[indexPath!.row]
          detailVC.detailTaskModel = thisTask
      }
  
  
  }
  
  //UITableViewDataSource
  func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return taskArray.count
  }
  
  func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
  
      let task = taskArray [indexPath.row]
      var cell: TaskCell = tableView.dequeueReusableCellWithIdentifier("myCell") as TaskCell
  
      cell.taskLabel.text = task.task
      cell.descriptionLabel.text = task.subTask
      cell.dateLabel.text = task.date
  
      return cell
  }
  //UITableViewDelegate
  
  func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
  
      performSegueWithIdentifier("showTaskDetail", sender: self)
  
  }
  </code></pre>