How can I pass a gesture recognizer from one view to another

I have a view which contains several subviews which are complex controls with several buttons.
The superview has gesture recognizers for taps, swipes etc.

In some cases, when receiving a single or double touch I would like the superview to pass the gesture recognizer to the subview for treatment.

  • Cordova notification plugin failed installation (Cordova 3.6)
  • UITextView - setting font not working with iOS 6 on XCode 5
  • Objective-C, interface declarations with properties
  • Parse Swift IOS - PFCloud callFunctionInBackground Selector not invoked
  • Form submit button event is not captured when keyboard is up iOS 7
  • Filtering NSArray of NSDictionary objects using NSPredicate
  • For instance:

    singletaprecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onSingleTapGestureRecognizerDetected:)];
    
    - (void)onSingleTapGestureRecognizerDetected:(UITapGestureRecognizer*)theTapGestureRecognizer
    {
        if (someCaseHappens) {
            // do something with the gesture - for instance - move a control from one place to another or some other UI action in the superview
        }
        else {
            // the subview will need to get the gesture and do something with it (imagine the touch was inside a button in a subview - the top superview should disregard the gesture and the button should be pressed) - THIS ISN"T HAPPENING NOW
        }
    }
    

    Solutions Collect From Internet About “How can I pass a gesture recognizer from one view to another”

    Well, you could create a custom view inheriting from UIView and then override:

    - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
    

    From this method you can return the view you want to handle the event.

    take a look at: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/instm/UIView/hitTest:withEvent: