Reputation: 5510
I have to create a UITableView that has sections within sections however I have never done this before and am not even sure if this is possible.
This is what it needs to look like
All fields are dynamic, so there could be 0 or more Header sections; would a UITableView be the best way to go about this? if so how would I approach this?
Upvotes: 1
Views: 762
Reputation: 11197
There is no easy way to do it, you have to plan cleverly.
From numberOfSectionsInTableView
return the number of "Header".
For each section in numberOfRowsInSection
return Sub Header + Cell in each sub header.
From cellForRowAtIndexPath
just chek if it is a sub header or a cell. If its is a sub header the return a cell which has a Label near to left side, if it is a cell then return a cell that has the label in more far away from left border.
You can use same cell just changing the frame of the cell's label.
Upvotes: 1