title: How do I populate two sections in a tableview with two different arrays using swift?
body: <p>I have two arrays Data1 and Data2 and I want to populate the data within each of these (they contain strings) into a tableview in two different sections.</p>
  
  <p>The first section should have a heading "Some Data 1" and the second section should be titled "KickAss".</p>
  
  <p>I have both sections populating with data from the first array (but with no headings either).</p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>override func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
      return 2
  }
  
  override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      var rowCount = 0
      if section == 0 {
          rowCount = Data1.count
      }
      if section == 1 {
          rowCount = Data2.count
      }
      return rowCount
  }
  
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell
      let ip = indexPath
      cell.textLabel?.text = Data1[ip.row] as String
      return cell
  }
  </code></pre>
  
  <p>in the cellForRowAtIndexPath method, is it possible for me to identify the section somehow like I did in the numberOfRowsInSection method?</p>
  
  <p>Also, how do I give titles to each section?</p>