Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1935
viewForSectionHeader or cellForSectionHeader... decisions decisions.
posted

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


Parents
No Data
Reply
  • 40030
    Verified Answer
    Offline posted

    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

Children
No Data