Trying to add a section every 2 indexPath.row swift
<p>Having a little problem with tableviews. I want to add a section to the tableview without messing with the content of the other data in the table. I want to add (cell3, thiscell) after every 2 indexpath.row 
What i have is a section on the storyboard which is one cell that i want to add after every 2 index path without messing with all the other information. How would i use the insert section function? or is there any other way to do it? </p>

<pre><code>func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
    // Table view cells are reused and should be dequeued using a cell identifier.
    if indexPath.section == 0 &amp;&amp; cell1 == true{
        let cellIdentifier = “cell1"
        let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! SubCategoryTableViewCell
        cell.nameLabel.text = “cell1"
        cell.subNameLabel.text = ""
        return cell
    } else  if indexPath.section == 2 &amp;&amp; vally == true{
        let cellIdentifier = "cell2"
        let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! SubCategoryTableViewCell
        cell.nameLabel.text = “Smiles"
        cell.subNameLabel.text = ""
        return cell
    } else if indexPath.row == 2 {
        let cellIdentifier = “cell3"
        let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! thisCell
        print("add this after indexpath 2")
        return cell
    } else if indexPath.section == 1 {
        let cellIdentifier = "SubCategoryTableViewCell"
        let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! SubCategoryTableViewCell
        cell.loading.hidden = false
        cell.loading.startAnimating()
        cell.nameLabel.text = subCat[indexPath.row].subCategoryName
        cell.subNameLabel.text = subCat[indexPath.row].subCategoryDesc
        return cell
    }
    let cell2: SubCategoryTableViewCell = tableView.dequeueReusableCellWithIdentifier("SubCategoryTableViewCell", forIndexPath: indexPath) as! SubCategoryTableViewCell
    cell2.userInteractionEnabled = false
    return cell2
}
</code></pre>