I would like to convert my current table view based data grids to the new UICollectionView classes.
This is how my current grids look like:

My grid has two headers:
- year (2006a, 2007a, etc) and
- type (“Revenue”, “EBITDA”, etc).
From Apple’s documentation I understand that I would need to subclass FlowLayout to get two headers (Apple Documentation) and, in particular, override layoutAttributesForSupplementaryViewOfKind:atIndexPath: to support new supplementary views (headers).
However, I did not find any sample or tutorial on how to do this. As I am stuck here, I would appreciate if you could point me to the right direction in coding this correctly.
Thank you.
I posted an example here an how to support decoration views. It would be similar for supplementary views, with the following differences:
– registerClass:forSupplementaryViewOfKind:withReuseIdentifier:on the UICollectionView instance– collectionView:viewForSupplementaryElementOfKind:atIndexPath:similar to the method for normal cells– layoutAttributesForSupplementaryViewOfKind:atIndexPath:to position the supplementary views at their positions– layoutAttributesForElementsInRect:make sure to add all the supplementary views you want (similar to the decoration view in the example I posted)I don’t have access to my example code right now, but I will post it later.