title: Exclude subviews from UIGestureRecognizer
body: <p>I have a UIView (the 'container view') which contains several 'sub views'. I want to add a UITapGestureRecognizer to the container view, such that it is activated when I touch the region inside the container view but outside the subviews. </p>
  
  <p>At the moment, touching anywhere inside the container view, including inside the subviews activates the gesture recognizer.</p>
  
  <p>The implementation looks something like this:
  In the controller:</p>
  
  <pre><code>ContainerView *containerView = [[ContainerView alloc] initWithSubViews:array];
  UITapGestureRecognizer *tap = [UITapGestureRecognizer alloc] initWithTarget:self action:@selector(someSelector)];
  [containerView addGestureRecognizer:tap];
  [self.view addSubView:containerView];
  </code></pre>
  
  <p>In ContainerView.m</p>
  
  <pre><code>-(id)initWithSubviews:(NSArray *)array {
      for (subView *s in array) {
          [self addSubView:s];
      }
      return self;
  }
  </code></pre>
  
  <p>I think the problem occurs because the gesture recognizer is added after the subviews are. If that is true then the solution would require breaking the initWithSubViews method into two separate ones, which I would prefer to avoid.</p>
  
  <p>Thank You</p>