title: How to make Supplementary View float in UICollectionView as Section Headers do in UITableView plain style
body: <p>I'm struggling to achieve a "floating section header" effect with <code>UICollectionView</code>. Something that's been easy enough in <code>UITableView</code> (default behavior for <code>UITableViewStylePlain</code>) seems impossible in <code>UICollectionView</code> without lots of hard work. Am I missing the obvious?  </p>
  
  <p>Apple provides no documentation on how to achieve this. It seems that one has to subclass <code>UICollectionViewLayout</code> and implement a custom layout just to achieve this effect. This entails quite a bit of work, implementing the following methods: </p>
  
  <p>Methods to Override</p>
  
  <p>Every layout object should implement the following methods:</p>
  
  <pre><code>collectionViewContentSize
  layoutAttributesForElementsInRect:
  layoutAttributesForItemAtIndexPath:
  layoutAttributesForSupplementaryViewOfKind:atIndexPath: (if your layout supports supplementary views)
  layoutAttributesForDecorationViewOfKind:atIndexPath: (if your layout supports decoration views)
  shouldInvalidateLayoutForBoundsChange:
  </code></pre>
  
  <p>However its not clear to me how to make the supplementary view float above the cells and "stick" to the top of the view until the next section is reached. Is there a flag for this in the layout attributes? </p>
  
  <p>I would have used <code>UITableView</code> but I need to create a rather complex hierarchy of collections which is easily achieved with a collection view. </p>
  
  <p>Any guidance or sample code would be greatly appreciated!</p>