A number of SO questions show that the autodetection method to determine the minimum size required for a view requires its limitations to be met: [header systemLayoutSizeFittingSize: UILayoutFittingCompressedSize]
Before making a call to systemLayoutSizeFittingSize: all the examples I saw force a layout update, for example:
[view setNeedsLayout]
I would like to know when this is actually necessary, because it seems to be sprinkled like a ritual seasoning: I would like to understand why I'm calling, and not doing it for good luck!
I just used systemLayoutSizeFittingSize: in some code, where I selectively update the view, which is a UITableView instance tableViewHeader (not the section title), and then resize it. It seems to be working fine without additional calls. I have this in my viewDidLoad :
{
Thanks.
source share