title: Programatically adding sections and cells to Table View Swift
body: <p>Say I have a list/array of sections:</p>
  
  <pre><code>let sections = [new Section("today", todaylist), 
                  new Section("yesterday", yestlist), 
                  new Section("25th February", list25f),...]
  </code></pre>
  
  <p>As you can see each section has a section name and a list of objects which will populate the cells inside that particular section.</p>
  
  <p>For now, let's say these objects are just simple strings.</p>
  
  <p>How would I programmatically loop through <code>sections</code> and create a new section with the appropriate title and the appropriate number of cells.</p>
  
  <p>I.e- the number of cells for section no. i would be:</p>
  
  <pre><code>sections[i].getList().count
  </code></pre>
  
  <p>in the case of "today" that would be equivalent to</p>
  
  <pre><code>todaylist.count
  </code></pre>
  
  <p>I can't add the sections in the storyboard because it will vary, the table view will be dynamic !</p>
  
  <p>Thanks for any help !</p>