Auto Layout Magic: Content Sizing Priorities

Auto Layout Magic: Content Sizing Priorities

One of my personal favorite things about good code and well-designed features is self-documentation. For the most part, a successful implementation of a feature without having to dive into online documentation feels like...well, magic.


Auto Layout however, has a few features that aren't very self-explanatory. Among these features are Content Hugging & Content Compression Priorities. BUT, before we go into these two features, we need to understand something else first - Intrinsic Content Size


Both of these properties can be set along both Vertical & Horizontal axes. This means that you can set priorities for both the width and height of a view.

[…]