I would like to change the font type and font size of a section header in a table view controller.
My code:
func tableView(tableView: UITableView, willDi
Simple working solution: (Swift 2.0)
func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
//Create label and autoresize it
let headerLabel = UILabel(frame: CGRectMake(0, 0, tableView.frame.width, 2000))
headerLabel.font = UIFont(name: "Avenir-Light", size: 30)
headerLabel.text = self.tableView(self.tableView, titleForHeaderInSection: section)
headerLabel.sizeToFit()
//Adding Label to existing headerView
let headerView = UIView()
headerView.addSubview(headerLabel)
return headerView
}