Hi all,
So I've been comparing these 2 methods considering how to make a custom section header cell, and I don't know which would be better…
Design my own view in a nib (or in code), and use the viewForSectionHeader, or inherit from an IGGridViewCellBase and use the cellForSectionHeader method.
Any opinions on which would be preferable?
IGGridViewDelegate Protocol
-(UIView *)gridView:(IGGridView *)gridView viewForSectionHeader:(NSInteger)section
IGGridViewDatasource Protocol
-(IGGridViewSectionCell *)gridView:(IGGridView *)gridView cellForSectionHeader:(NSInteger)section
Hey Dave,
I would go with the latter.
We added that as an additional feature a few versions after the initial release. The viewForSectionheader will ask for all the views up front, while the cellForSectionHeader will only be asked on demand.
You'll need to return an IGGridViewSectionCell. For the secitonHeader, we actually have a helper method which can help you. Plus if you plan on allowing users to expand and collapse sections, you'll have all the functionality you would need baked in, you don't even have to write the dequeue code.
IGGridViewSectionHeaderCell* cell = [IGGridViewSectionHeaderCell gridView:grid cellForSectionHeader:sectionIndex];
-SteveZ