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, willDisplayHeaderView view: UIView, forSection section: Int) { let header = view as! UITableViewHeaderFooterView header.textLabel.textColor = UIColor.blackColor() header.textLabel.font = UIFont(name: "Futura", size: 38)! }
But this doesn't work. Any ideas?
override func tableView(tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) { let header = view as! UITableViewHeaderFooterView header.textLabel?.font = UIFont(name: "Futura", size: 38)! header.textLabel?.textColor = UIColor.lightGrayColor() }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With