Skip to content

Instantly share code, notes, and snippets.

@mluton
Created April 10, 2013 05:29
Show Gist options
  • Save mluton/5352050 to your computer and use it in GitHub Desktop.
Save mluton/5352050 to your computer and use it in GitHub Desktop.
Detect which subview was tapped
- (void)handleTapFrom:(UITapGestureRecognizer *)recognizer
{
CGPoint point = [recognizer locationInView:self.view];
UIView *tappedView = [self.view hitTest:point withEvent:nil];
if ([tappedView isKindOfClass:[SingleDesignerView class]]) {
int row = ((SingleDesignerView*)tappedView).row;
NSDictionary *designer = self.designers[row];
NSLog(@"person: %@ %@", designer[@"name"], designer[@"slug"]);
FontDesignerBioViewController *fdbvc = [[FontDesignerBioViewController alloc] initWithNibName:@"FontDesignerBioViewController" bundle:nil];
fdbvc.titleText = designer[@"name"];
fdbvc.designerSlug = designer[@"slug"];
[self.navigationController pushViewController:fdbvc animated:YES];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment