Fullsize view on tap rather than on a pinch-zoom? #125

Open
jk opened this Issue Jun 15, 2012 · 5 comments

Projects

None yet

2 participants

jk commented Jun 15, 2012

I want to open the fullsize view of a cell on both occurences: if a person taps on it but also when he pinches. The latter is in the example, but I haven't figured what to do on - (void)GMGridView:(GMGridView *)gridView didTapOnItemAtIndex:(NSInteger)position. Did I miss something or isn't it implemented yet?

The didTapOnItemAtIndex:(NSInteger)position Method is one of the delegates you have to implement. Like didSelectRowAtIndexPath in a UITableView.
Just put the code you use for fullsize in there and thats it.

jk commented Jun 19, 2012

But there's no public method to call to invoke the same behavior as to pinchZoom on a cell which gets its UIView from - (UIView *)GMGridView:(GMGridView *)gridView fullSizeViewForCell:(GMGridViewCell *)cell atIndex:(NSInteger)index. I definitely can call that method and show the UIView by my self, but I rather want to repeat existing code to enter fullsize mode.

Maybe you should take a look at the methods of GMGridViewCell
There is the public method

  • (void)switchToFullSizeMode:(BOOL)fullSizeEnabled
    This should do the trick i think.

I think you could also just use the code from the transformingGestureDidFinish delegate method to do the zoom.
Thats also the method where switchToFullSizeMode is called

jk commented Jun 19, 2012

Sadly it does not.

- (void)GMGridView:(GMGridView *)gridView didTapOnItemAtIndex:(NSInteger)position {
    GMGridViewCell *cell = [gridView cellForItemAtIndex:position];
    [cell switchToFullSizeMode:YES];
}

If I set a breakpoint on -(void)switchToFullSizeMode:(BOOL)fullSizeEnabled I can see that it is only called by GMGridViews -(void)transformingGestureDidFinish and that in turn is called with this construct:

[NSObject cancelPreviousPerformRequestsWithTarget:gridView selector:@selector(transformingGestureDidFinish) object:nil];
[gridView performSelector:@selector(transformingGestureDidFinish) withObject:nil afterDelay:0.1];

I obviously lack certain skills here, I can't see why this isn't working. I assume I miss setting some internal flags like _transformingItem.

hmm. Maybe if i have time tomorrow i'll look into it and try it myself. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment