title: UICollectionview immediate layout update
body: <p>I am having a small problem I just can't find a solution for.</p>
  
  <p>I am trying to invalidate the layout of a UICollectionViewFlowLayout after the first cell is dequeued in <code>collectionView(collectionView:, cellForItemAtIndexPath indexPath:)</code> so it fits it's content before appearing to the user. I need to do this this way, because I need to access the cells ui elements, which are not available the first time <code>sizeForItemAtIndexPath</code> is called.</p>
  
  <p>In iOS 8 this works fine, but in iOS 7 <code>invalidateLayout</code> doesn't update the layout immediately, just as stated in the Apple Documentation:</p>
  
  <blockquote>
    <p>It is useful to remember that calling the invalidateLayout method does not begin the layout update process immediately. The method merely marks the layout as being inconsistent with the data and in need of being updated. During the next view update cycle, the collection view checks to see whether its layout is dirty and updates it if it is. In fact, you can call the invalidateLayout method multiple times in quick succession without triggering an immediate layout update each time.</p>
  </blockquote>
  
  <p>Now I am wondering if there is a workaround for iOS 7 which updates the flow layout immediately.</p>
  
  <p><code>reloadData</code> is not a solution, because calling it while dequeuing cells messes up the whole collectionview.</p>