Programmatically compute UICollectionViewCell sizes from AutoLayout constraints made in Storyboard?
<p>The goal is to programmatically compute cell sizes for a UICollectionView based on constraints made in Storyboard inside of a UICollectionViewCell.</p>

<p>In other words, the sizes for elements of a UICollectionViewCell are defined inside of Storyboard using AutoLayout constraints.</p>

<p>But how do you gain access to those constraints in order to programmatically implement <code>func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath)</code>?</p>

<p>The alternative is to hard code the values inside the view controller, but then you're defining sizes twice: once in Storyboard and once in code.</p>

<p>Is it possible to define the sizes once inside of Storyboard then let the view controller compute the cell sizes based on those constraints?</p>