Unfortunately, you may have to override this:
In Objective-C:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
In Swift:
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView?
Try something like this:
In Objective-C:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UILabel *myLabel = [[UILabel alloc] init];
myLabel.frame = CGRectMake(20, 8, 320, 20);
myLabel.font = [UIFont boldSystemFontOfSize:18];
myLabel.text = [self tableView:tableView titleForHeaderInSection:section];
UIView *headerView = [[UIView alloc] init];
[headerView addSubview:myLabel];
return headerView;
}
In Swift:
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let myLabel = UILabel()
myLabel.frame = CGRect(x: 20, y: 8, width: 320, height: 20)
myLabel.font = UIFont.boldSystemFont(ofSize: 18)
myLabel.text = self.tableView(tableView, titleForHeaderInSection: section)
let headerView = UIView()
headerView.addSubview(myLabel)
return headerView
}