title: Pass events onto another view
body: <p>I have a situation in which I would like to place a UIView (that is not my code) on top of another UIView and have events propagated to the bottom most view.  To be more concrete I would like to place a UIView on top of a MKMapView.</p>
  
  <p>I have a UIView that contains both the views (as subviews).  I would like my uiview to forward on the events from its view to both its subviews.</p>
  
  <p>.h:</p>
  
  <pre><code>@interface MyUIView : UIView
  
  @end
  </code></pre>
  
  <p>.m:</p>
  
  <pre><code>#import "MyMapView.h"
  
  #import &lt;MapKit/MapKit.h&gt;
  
  #import "MapGestureRecognizer.h"
  
  @implementation MyMapView
  
  MKMapView *mkMapView;
  
  - (id)initWithFrame:(CGRect)frame
  {
      self = [super initWithFrame:frame];
      if (self) {
          // Initialization code
      }
  
      mkMapView = [[MKMapView alloc] initWithFrame:frame];
      [self addSubview:mkMapView];
  
  // Create another view to place on top of the mkMapView
  // This is not my view I do not control is codebase.  I would like to put it on top of the mkMapView
  // and still have the mkMapView receive touch events
      UIView * otherView = [[UIView alloc] initWithFrame:frame];
      otherView.backgroundColor = [UIColor clearColor];
      [self addSubview:otherView];
  
      MapGestureRecognizer *mgr = [[MapGestureRecognizer alloc] init];
      mgr.touchesBeganCallback = ^(NSSet * touches, UIEvent * event) {
          UITouch *touch = [[event allTouches] anyObject];
          NSLog(@"touches began=%@", [NSString stringWithFormat:@"%i", touch.view.tag]);
  
          [mkMapView touchesBegan:touches withEvent:event];
  
      };
  
      mgr.touchesCancelledCallback = ^(NSSet * touches, UIEvent * event) {
          UITouch *touch = [[event allTouches] anyObject];
          NSLog(@"touches cancelled=%@", [NSString stringWithFormat:@"%i", touch.view.tag]);
  
          [mkMapView touchesCancelled:touches withEvent:event];
  
      };
      mgr.touchesEndedCallback = ^(NSSet * touches, UIEvent * event) {
          UITouch *touch = [[event allTouches] anyObject];
          NSLog(@"touches ended=%@", [NSString stringWithFormat:@"%i", touch.view.tag]);
  
          [mkMapView touchesEnded:touches withEvent:event];
  
      };
      mgr.touchesMovedCallback = ^(NSSet * touches, UIEvent * event) {
          UITouch *touch = [[event allTouches] anyObject];
          NSLog(@"touches moved=%@", [NSString stringWithFormat:@"%i", touch.view.tag]);
  
          [mkMapView touchesMoved:touches withEvent:event];
  
      };
  
      [self addGestureRecognizer:mgr];
  
      return self;
  }
  
  
  @end
  </code></pre>
  
  <p>I implemented my own gesture recognizer to intercept these events and I am trying to pass to intercepted events through to the mkMapView.  I see the log messages however it does not seem to pass the events through as I can make the mkmapview scroll/pan.</p>