I have a series of imageviews that I identify using their tag. I have added a single tap gesture to the images.
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(selectImage:)];
[tableGridImage addGestureRecognizer:singleTap];
tableGridImage.userInteractionEnabled = YES;
[singleTap release];
This manages to call the selectImage selector ok, but passes the gesture as the sender. I need the imageview as the sender so I can get the tag.
Any ideas on how I can get the imageview and it's tag?
I figured out how to get the tag, which was the most important part of the question for me. Since the gesture is the sender, I figured out the the view it is attached to is sent along with it:
[(UIGestureRecognizer *)sender view].tag
I am still curious if anyone can tell me how to send an argument through a UITapGestureRecognizer selector.