Referring to the picture above, I don't know the best way to do this for performance, but I'm guessing I'd go about it like this…
Obtain a section header cell from IGGridViewSectionHeaderCell +gridView:cellForSectionHeader:
Create and size three UIViews (light purple boxes) and place them in the section header cell.
UIView 1 has the circular icon which would either be an image, or be drawn in code.
UIView 2 would be a label
UIView 3 would be an image.
Each of the UIViews would need a tap gesture recognizer
The UIViews 1 and 2 would have a tap recognizer that would toggle the expand / collapse behavior
UIView 3 would have a tap recognizer that would take you to another gridview.
Hey Dave
Id derive from the section header cell and extend it that way.
I'm taking a long weekend, but when I come back I could throw a sample together for you. Not sure how soon you need this.
-SteveZ
I'll try and tackle it, but I always love a good sample.
Throw one up when you get back if it's no problem
Have a good weekend.
Dave.
Hey Dave,
Here's that sample I promised.
Excellent Steve, thanks a lot.
I have a question for you on the example.
Say I wanted to dual purpose the _circle UIView such that tapping it not only called setState to evaluate the data, and perhaps change the color, but ALSO to forward the tap to the section header so that it would collapse/expand as it would if you'd tapped it directly.
I've been playing with Gesture Recognizers and Target-Action and TouchesEnded, etc, and I can't find a combination that does both of those things.
I seem to be able to only EITHER expand/collapse, OR set state, but not both.
Is both possible?
Purrrrfect as my cat would say.
Just call the expand/collapse code your self.
There is a expand method as well as a collapse. You can see the current expanded state by checking the expanded property.
So something like.
if(self.expanded)
[self collapse];
else
[self expand];