---
title: "Content hugging and compression resistance"
slug: content-hugging-and-compression-resistance
section: tech
date: 2015-08-25T17:44:00.000Z
canonical: https://roland.leth.ro/blog/tech/content-hugging-and-compression-resistance
---

Even though the names might sound self-explanatory, I never really understood how they work. But I finally [found](http://www.informit.com/articles/article.aspx?p=2151265&seqNum=8) a proper explanation about them:

> A strong hugging priority limits the view from growing much larger than the content it presents. A weak priority may allow a view to stretch and isolate its content among a sea of padding.
> Compression resistance describes how a view attempts to maintain its minimum intrinsic content size.

I'm considering to buy the book too, while I'm at it.

*Update, 2015-09-16:* [This piece](http://krakendev.io/blog/autolayout-magic-like-harry-potter-but-real) is really, really nice as well. As he points out:

> When I first started out, I actually wish I could have had something like this guide to help me out.
