title: Resizing UICollectionView based on number of cells
body: <p>I have a <code>UICollection</code> view with 1-4 cells, and underneath a <code>UITextField</code> is constrained to the bottom of it.</p>
  
  <p>I want to be able to resize the <code>UICollectionView</code> so if it has 1 or 2 cells, the height of the <code>UICollectionView</code> is this height, otherwise given it has 3 or 4 cells, the height is the 2 * cell height + vertical spacing.</p>
  
  <p>Is there a simple way to do this without all of the maths? It seems odd to have the constraints system and still have to do this laborious maths to size a <code>UIView</code>.</p>
  
  <p>Thanks as always</p>