How to pad a UITableView section header?

ios, objective-c, xcode

Solution

I couldn't easily do it using the titleForHeaderInSection so I decided to use a custom cell with viewForHeaderInSection.

Problem

How would you add some padding to a section header in a UITableView cell? I have this: I have an NSDictionary whose key values contain a string of times. I stored the key values in an NSArray. I am using titleForHeaderInSection instead of viewForHeaderInSection. ``` - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return [schedule objectAtIndex:section]; } ``` However, the section header is aligned all the way to the left. I can pad it to my liking using a UIView for viewForHeaderInSection, but is there any way to do it for the method titleForHeaderInSection?

Original source

Related problems