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