i have changed the backgroundColor/backgroundImage of my tableviews sections.
I am using plain tableView.
No worries, get worked without problems with this code:
Implement method below from UITableViewDelegate, and needed ui view.
func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UITableViewHeaderFooterView()
view.contentView.backgroundColor = UIColor(white: 0.97, alpha: 1)
return view
}
If you need change footer use similar code in ...viewForFooterInSection.. method
Want to draw you own font, use similar customization:
...
let label = UILabel(frame: CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), tableView.sectionHeaderHeight))
label.font = UIFont(name: "HelveticaNeue", size: 14)!
label.text = self.tableView(tableView, titleForHeaderInSection: section)
view.contentView.addSubview(label)
view.textLabel.hidden = true
...