title: How to add separators between UITableView sections?
body: <p>I'm implementing a tableview, which has 3 sections(section count remain static) and each section contain several rows.</p>
  
  <p><strong>Behaviour 1:</strong> Add section header to only the third section.</p>
  
  <p><strong><em>How did I achieve:</em></strong></p>
  
  <pre><code>func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -&gt; UIView? {
      if section == 2 {
         //create and return header view
      }
      return UIView(frame: CGRect(x: 0, y:0, width: tableView.width, height: UIScreen.main.scale))
  }
  </code></pre>
  
  <p><strong>Behaviour 2:</strong> TableViewCells shouldn't have separator. But, Sections should be separated with a thin line. (similar to tableviewcell separator)</p>
  
  <p><strong><em>What did I try:</em></strong></p>
  
  <ul>
  <li>Add a one pixel height, tableView width UIView, with all required properties set(color, etc) and add it as a sub-view to the section header view's</li>
  <li>Add drop shadow with CGPoint(0,1) to the section header views</li>
  </ul>
  
  <p>None of them worked out.</p>
  
  <p><strong><em>How did I achieve this:</em></strong></p>
  
  <ol>
  <li>Find last cell in every section,</li>
  <li>Create an UIView with 1px height, tableView's width and add it as a subview to the last cell</li>
  </ol>
  
  <p>Though this seem to work. I feel, there must be a better way of doing this, rather than adding line to bottom of every section's last tableView cell. Does anyone know a better way of implementing such behaviour?</p>