Where to place touchesEnded-code [UIResponder]?

Discussion in 'iOS Programming' started by Danneman101, Jul 29, 2010.

  1. macrumors 6502

    Aug 14, 2008
    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];
    // DEBUG:
    	NSLog(@"--== touchPosition = %@", NSStringFromCGPoint(touchPosition));	
    // TODO: Construct CGRect somehow using the CGPoint

Share This Page