Why in shouldReceiveTouch does my gesture recognizer always report being tapped in the same location?

ios, objective-c, uigesturerecognizer, uitapgesturerecognizer

Solution

I think this is the expected behavior because, "This method is called before touchesBegan:withEvent: is called on the gesture recognizer for a new touch". So, I think this means the recognizer won't know about its location yet. To get the location, use the touch argument provided instead:

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)recognizer shouldReceiveTouch:(UITouch *)touch {
    NSLog(@"%@", NSStringFromCGPoint([touch locationInView:self.view]));
    ...

Problem

I have the following code: ``` - (BOOL)gestureRecognizer:(UIGestureRecognizer *)recognizer shouldReceiveTouch:(UITouch *)touch { NSLog(@"%@", NSStringFromCGPoint([recognizer locationInView:self.view])); ... ``` Every time I tap, however, I get `{0, -64}`. No matter where I tap. What am I doing wrong?

Original source