View Full Version : Where to place touchesEnded-code [UIResponder]?

Jul 29, 2010, 07:00 PM
Im trying to implement a popupview that targets a button inside a webview.

For that purpose I need to get the CGRect of the that button, which I figure is best done by getting the position of the last touch using the UIResponder > touchesEnded method.

Problem is, I dont have a clue where to put the code. I tried all my projects files (which is an iPad split-view app, containing two viewcontrollers and a appdelegate), but none of them trigger the method.

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
UITouch *touch = [touches anyObject];
CGPoint touchPosition = [touch locationInView:self.view];
NSLog(@"--== touchPosition = %@", NSStringFromCGPoint(touchPosition));
// TODO: Construct CGRect somehow using the CGPoint