I'm using the following code to detect a touch on a table cell image. How would I go about enlarging the image on that touch?
The part I'm stuck on is how would I make the cell.userSubmittedImageView accessible from the myFunction method?
from cellForRowAtIndexPath:
method
...
cell.userSubmittedImageView.userInteractionEnabled = YES;
cell.userSubmittedImageView.tag = indexPath.row;
UITapGestureRecognizer *tapped = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(myFunction:)];
tapped.numberOfTapsRequired = 1;
[cell.userSubmittedImageView addGestureRecognizer:tapped];
return cell;
}
-(void)myFunction :(id) sender
{
UITapGestureRecognizer *gesture = (UITapGestureRecognizer *) sender;
NSLog(@"Tag = %d", gesture.view.tag);
}