title: Tableview within tableview swift
body: <p>I need to have a view which has a <code>UITableView</code> and the <strong>main</strong> <code>UITableView</code> has a cell that has another tableview.
  I have added the view on storyboard and implemented the delegate and datasource methods in a single viewcontroller.
  But the tableview methods are not getting called for the inner tableview since i have set inner tableview delegate and datasource like this:</p>
  
  <pre><code>func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
      let cell: UITableViewCell = UITableViewCell()
  
      switch tableView.tag {
      case 1:
          if indexPath.section == 0 {
              let pendingReportsCell = tableView.dequeueReusableCellWithIdentifier("PendingReportsCell") as! PendingReportsTableViewCell
              pendingReportsCell.taxYearTableView.delegate = self
              pendingReportsCell.taxYearTableView.dataSource = self
              taxTableView = pendingReportsCell.taxYearTableView
              taxTableView?.registerClass(UITableViewCell.self, forCellReuseIdentifier: "EarliestMonthTaxYearCell")
              tableView.tag = (taxTableView?.tag)!
              taxTableView?.reloadData()
   }
  </code></pre>
  
  <p>Please tell me an alternate to do this.</p>