UITableView Section Header Behavior iOS 9.X vs 10.x

94 views Asked by At

I am having an issue where my tableView:viewForHeaderSection: is being called a different amount of times in IOS 9.X VS 10.X.

In 9 it only gets called once(which is incorrect) while in 10 it gets called for all the correct sections I have set in the FRC.

Is anyone aware of any difference in how an FRC handles the sectionNamekeyPath between 9 and 10? I haven't successfully found anything in the documentation.

Thank you.

1

There are 1 answers

1
Ankur On

here below solution Working for me both iOS9 and iOS10

The use of tableView:viewForHeaderInSection: requires that you also implement tableView:heightForHeaderInSection:. This should return an appropriate non-zero height for the header. Also make sure you do not also implement the tableView:titleForHeaderInSection:. You should only use one or the other (viewForHeader or titleForHeader)