Closed TomWol closed 12 years ago
Typically, you'd leave KKGridView
itself alone, and implement the desired behavior in its delegate (your view controller) according to the <KKGridViewDelegate>
profile. Have you tried this? If so, is -[<KKGridViewDelegate> gridView:didSelectItemAtIndexPath:]
not working properly for you?
Jon
Yeah, you'd implement the -didSelectItem method, then pass the indexPath with something like...
ItemViewController *itemView = [[ItemViewController alloc] initWithNibName:whateverPeopleWhoUseNibsCallTheirStupidNibs];
itemView.indexPath = indexPath; /* this is passed in the method from KKGridView */
I figured it was something this easy, just didn't think of it. Works like a charm, thanks to both of you.
I am trying to integrate this great gridview with a photoviewer, where after one taps on a cell (which I've adapted to display a thumbnail of an image), a new view controller is pushed with the photoviewer (and the index is passed on).
Now, with the way taps on a cell are detected (with _handleSelection in KKGridView), I'm having trouble achieving this. I have located the part where the proper cell has been identified as this part of that code:
But my question is: how can I, from this point, somehow push a view controller with that indexPath? Obviously I can't do this in this part of the code as there's no navigation controller, but it is the only part of the code where tapping on a cell is accurately detected (other than highlightItemAtIndexPath, but that's in the same class so the problem remains).
I am new to iOS development, so this may be really obvious, but I have been trying this for days. Thank you in advance.