I want to make a UITableView as close to the iOS settings view as possible:
How do i create the space between different sections? What\'s the best way?
First of all the iOS Settings doesn't use the ViewForSection otherwise the Section view would be placed in the top tableView.
You can return an empty containerView cell for that specific indexPath and stop didSelect in it, but remember to include the empty cells to the array you are using for other cells.
You just select grouped style in the Interface Builder and it will separate the table per section, similar as is in the screenshot.
Here is an attachment:
Just add the footer height in the table as required:
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 44
}
Change Style of UITableView to "Grouped"
try these..
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 30; //according to your need..
}
i hope it helps..