Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

viewForHeaderInSection is called for every section but the first UITableView

I have a UITableView and a UITableViewController which is the delegate of the table view. I have multiple sections in my UITableView, and I need to set a custom header for the first section. Unfortunately, the method override func tableView(tableView: UITableView!, viewForHeaderInSection section: Int) -> UIView! (swift) is being called for every section but section 0 which is the first section. All of my other UITableView delegate and datasource methods are working correctly and I have no methods that should override this method.

like image 859
jamespick Avatar asked Jul 08 '14 16:07

jamespick


1 Answers

From the documentation:

This method only works correctly when tableView:heightForHeaderInSection: is also implemented.

like image 138
Graham Dawson Avatar answered Oct 07 '22 13:10

Graham Dawson