Disable gesture recognizer only for a particular view

Swift 3 version:

func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
    if theView.bounds.contains(touch.location(in: theView)) {
        return false
    }
    return true
}

You should accept Bharat's answer because that is correct. I only want to illustrate how you do it:

  1. Define your view controller as conforming to UIGestureRecognizerDelegate, e.g.:

    @interface ViewController () <UIGestureRecognizerDelegate>
    // the rest of your interface
    @end
    
  2. Make sure you set the delegate for the gesture:

    UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleMainTap:)];
    gesture.delegate = self;
    [self.view addGestureRecognizer:gesture];
    
  3. Then have and then check to see if the touch takes place for the view in question:

    - (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
    {
        if (CGRectContainsPoint(self.menuView.bounds, [touch locationInView:self.menuView]))
            return NO;
    
        return YES;
    }
    

You could use the gestureRecognizer:shouldReceiveTouch: method in your UIGestureRecognizerDelegate to see where the touch occurred and decide whether or not you want to respond to the gesture. Return NO if the touch is too close to the edge of your View(where you want ti disabled), otherwise return YES. Or simply check the touch.view to see if the touch occurred on your UIImageView.

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer 
   shouldReceiveTouch:(UITouch *)touch;