3 ms·
There’s one thing you cannot do with manual layout, and that is composability. If you write a custom container, but want the contents of the container to provid
by tzahola 9y ago
There’s one thing you cannot do with manual layout, and that is composability. If you write a custom container, but want the contents of the container to provide sizing information upwards, you can do that pretty easily with AutoLayout. Constraints propagate information automatically in both directions. You can simulate something similar with sizeToFit/sizeThatFits, but you’ll find out pretty soon that your components are not as generic as you thought they were. E.g. how to trigger a grandparent relayout from a deeply nested child view, when it no longer fits its current size? Autolayout does that automatically.
- nielsbot 9y agoI use the intrinsicSize property to send requested size info upwards (subview->superview). using that you can resize your views correctly during the layout.