The documentation is pretty clear on this. -sizeToFit
pretty much calls -sizeThatFits:
(probably with the view’s current size as the argument), and the default implementation of -sizeThatFits:
does almost nothing (it just returns its argument).
Some UIView subclasses override -sizeThatFits:
to do something more useful (e.g. UILabel). If you want any other functionality (such as resizing a view to fit its subviews), you should subclass UIView and override -sizeThatFits:
.