Created
April 10, 2013 05:29
-
-
Save mluton/5352050 to your computer and use it in GitHub Desktop.
Detect which subview was tapped
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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