I have setup a uitableview with custom cells.
I would like these into sections with a title. Looking at the below photo I am looking for the following layout:
Section – My Profile
Custom cell – wwwwwwwwwwwwww…
Section – Application
Custom cell – Games
Custom cell – Share
Custom cell – Rate
Custom cell – Settings
Custom cell – Help
Custom cell – Log out
I can see how to add a section and control the rows in a section, but this duplicates the cells into multiple sections, I am not sure how to have one section with one row and another section with 6 rows. I also want to style these sections to show, slightly like the Facebook menu style.
Should I create custom cells for the actual sections instead and have no action on the section (cell) selection?
Here is the code for the UITableView
static NSString *CellIdentifier = @"Cell";
LeftMenuTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray* views = [[NSBundle mainBundle] loadNibNamed:@"LeftMenuTableViewCell" owner:nil options:nil];
for (UIView *view in views) {
if([view isKindOfClass:[UITableViewCell class]]) {
cell = (LeftMenuTableViewCell*)view;
}
}
}

You could define number of sections and rows in it as following: