Beginning Auto Layout - Part 4: Intrinsic Content | Ray Wenderlich

Learn how various UI elements can have a preferred size, based on the content, and how this affects your layouts.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3937-beginning-auto-layout/lessons/4

Iā€™m still not sure Iā€™m following if the hugging says the width is <= intrinsic size and compression >= intrinsic size that to me means that it will always be at its intrinsic size.

It would seem like it, but the key is that neither priority is usually required (1000). If one constraint says make it <= intrinsic size with a priority of 250 and make it >= intrinsic size with a priority of 750, it will try to make it exactly equal to its intrinsic size, but if it cannot, it uses those priorities to decide whether to compress or stretch the view. Does that help?