I have a custom UIView containing a TableView. Above the table I plan to display some other items. For now, I just want a button.
I am creating a UIView 'headerView', and adding the button to it. The button itself is just rigged to update it's title when it is pressed.
If I add the headerView to the table view as the tableHeaderView, it works just fine.
If I add the headerView above the tableview, as a sibling subview, it displays correctly but the button title does not update.
I have verified through logging that the method to update the button label is called, but the view seems to need a refresh.
Why would this be? Am I missing something simple.
Code to follow if it would help.
Note: I am not using IB for any of this.
Update:I have narrowed it down to one line. When I set the frame of the tableview, which I add below the headerView, I am setting the origin.y to the headerView.size.height. If I change this to use a hard coded number (even of the same value), the button updates.