Can someone please instruct me on the easiest way to change the font size for the text in a UITableView section header?
I have the section titles implemented using the following method:
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
Then, I understand how to successfully change the section header height using this method:
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
I have the UITableView cells populated using this method:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
However, I'm stuck as to how to actually increase the font size - or for that matter the font style - of the section header text?
Can someone please assist? Thanks.
Swift 4 version of Leo Natan answer is
If you wanted to set a custom font you could use
With this method you can set font size, font style and Header background also. there are have 2 method for this
First Method
Second Method
For iOS 7 I use this,
Here is Swift 3.0 version with header resizing