There are some section in the table that does not contain any data and would like to hide that section.
How to do this?
You can set the particular section rows height to 0. Also, with the section header if you want. Datasource would still be there, only not showing up.
Section Rows
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0) {
if (_shouldHidden) {
return 0.0;
}
else {
return 55.0;
}
}
else {
return 55.0;
}
}