title: How to custom order two different sections in a tableview Swift
body: <p>I have successfully implemented two different sections in my table view. Section 1 has 3 cells displayed first, then section 2 has 12 displayed afterwards.</p>
  
  <p>I would like to have it ordered so section 1 has its 3 cells mixed into section 2 (12 cells) So in this case it would be displayed every 4 cells. I would like to code it in a way that when the section 2 cells increases over time it keeps section 1 every 4 cells.</p>
  
  <p>Here is the tableview delegate functions I have at the moment</p>
  
  <pre><code>func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
      // #warning Potentially incomplete method implementation.
      // Return the number of sections.
  
      return 2
  }
  
   func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      // #warning Incomplete method implementation.
      // Return the number of rows in the section.
      if (section == 0) {
      return 3 // At the moment I have hard coded it will change it to array.count
      } else {
          return eventNameArray.count
      }
  }
  
  func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
  
      if indexPath.section == 0 {
      let cell = tableView.dequeueReusableCellWithIdentifier("MovingCell", forIndexPath: indexPath) as! WhatsOnMovingTableViewCell
       // Do something!
      return cell
      }
      else {
      let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! WhatsOnTableViewCell
      // Do something!
      return cell
      }
  }
  </code></pre>