title: How to load different arrays when tapping cells in TableViewController?
body: <p>I've been looking for hours and can't seem to find an answer for this. My swift file contains over 20 really long arrays but I'm going to simplify it in this question with a short similar example.</p>
  
  <p>Let's say I have a "Class A" with an array that goes like this:</p>
  
  <pre><code>var mainArray = ["One, "Two", "Three"]
  
  override func viewDidLoad()
  {
      super.viewDidLoad()
  
  }
  
  override func didReceiveMemoryWarning()
  {
      super.didReceiveMemoryWarning()
  }
  
  override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return mainArray.count
  }
  
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
      let cellA = tableView.dequeueReusableCellWithIdentifier("prototype1", forIndexPath: indexPath)
      cellA.textLabel?.text = mainArray[indexPath.row]
      return cellA
  }
  </code></pre>
  
  <p>and then there's "Class B" with multiple arrays, like so:</p>
  
  <pre><code>var arrayOne = ["A", "B", "C"]
  var arrayTwo = ["D", "E", "F", "G"]
  var arrayThree = ["H", "I"]
  var itemArray = [String]()
  
  override func didReceiveMemoryWarning()
  {
      super.didReceiveMemoryWarning()
  }
  
  override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int
  {
      return itemArray.count
  }
  
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell
  {
      let cellB = tableView.dequeueReusableCellWithIdentifier("prototype2", forIndexPath: indexPath)
      cellB.textLabel?.text = itemArray[indexPath.row]
      return cellB
  }
  </code></pre>
  
  <p>What I've been trying to figure out is how to choose a specific array to display.</p>
  
  <p>For example, in this case I would want to tap the cell with the label 'Two' in the main array and segue to the second view controller (Class B) and display four cells labeled:</p>
  
  <p>D</p>
  
  <p>E</p>
  
  <p>F</p>
  
  <p>G</p>
  
  <p>respectively.</p>
  
  <p>If anyone can help me with this I will greatly appreciate it.</p>