How to set UICollectionViewCell size?
<p>I want to change collectionViewCell size from</p>

<pre><code>func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
</code></pre>

<p>For this I do:</p>

<pre><code>(collectionView.collectionViewLayout as! UICollectionViewFlowLayout).itemSize = 1000
</code></pre>

<p>but it does not change the size at all. Also, I have the next function:</p>

<pre><code>func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -&gt; CGSize {
    var newSize: CGSize?

    let width = CGRectGetWidth(collectionView.frame)
    newSize = CGSize(width: width, height: width + 100)

    return newSize!
}
</code></pre>

<p>So, how can I override it from the <code>cellForItemAtIndexPath</code>?</p>