I'm setting the tableHeaderView of a UITableView, but it is hiding the top cells of the table. In my case, I want to show tableview header I have used all possible solutions but not works. Please help.
UIView *headerView = self.headerView;
[headerView setNeedsLayout];
[headerView layoutIfNeeded];
CGFloat height = [headerView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
headerView.frame = ({
CGRect headerFrame = headerView.frame;
headerFrame.size.height = height;
headerFrame;
});
NSLog(@"Header Frame : %@",headerView);
self.reviewsTableView.tableHeaderView = headerView;

I was work around this issue, In my case real issue was with constraints in the storyboard.
Or if you are setting it programmatically then you needed to call
updateConstraintsIfNeededmethod after setting of constraints to the widget.