I need to add custom header to my table
I try this
func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.size.width, height: 18))
let label = UILabel(frame: CGRect(x: 20, y: 20, width: 50, height: 50))
label.text = "TEST TEXT"
label.textColor = UIColor.whiteColor()
self.view.addSubview(view)
return view
}
but this doesn't work, I see nothing on table
What am I doing wrong ? Or maybe there is another ways ?