title: Gesture Not Recognized on subview
body: <p>I am trying recognize gestures in a subview. I only get response when i define the gestureRecognizer in the superview. I wanted to know why i am not getting the gestutre response when i define it with in the subview which in my case is 'View.m', although i get response when i define the gestureHandler in the superview which in my case is the view of ViewController but i want why it isnt working in subview.  The Code Will Make it more clear. Also the gestures arent recognized during Animation as in my case im moving the subview from left to right in my 'view.m' and when i click during animation gestures arent recognized . i have tried UIViewAnimationOptionAllowUserInteraction but still no gestures are recognized.</p>
  
  <p>This is the SubView Class With a TapgesturHandler</p>
  
  <pre><code>//  View.m
  //  GestrureonImageView
  //
  //  Created by Noman Khan on 8/24/12.
  //  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
  //
  
  #import "View.h"
  
  @implementation View
  
  - (id)initWithFrame:(CGRect)frame
  {
  
      self = [super initWithFrame:frame];
      if (self) {
          // Initialization code
      }
  
      UITapGestureRecognizer *tapGestures=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gesturesCallBack:)];
  
      // NSLog(@"init gestures");
  
      [tapGestures setDelegate:self];
  
      // Set required taps and number of touches
      [tapGestures setNumberOfTapsRequired:1];
      [tapGestures setNumberOfTouchesRequired:1];
      [self addGestureRecognizer:tapGestures];
      return self;
  }
  -(void) gesturesCallBack:(UITapGestureRecognizer *)sender 
  {
      NSLog(@"abcView");
      [UIView animateWithDuration:10 
  
                            delay:0.1
                          options:UIViewAnimationOptionAllowUserInteraction
                       animations:^
       {
           // [self initGestures];
           CGAffineTransform transform = CGAffineTransformMakeTranslation(500,0);
  
           self.transform = transform;
       }
                       completion:^(BOOL finished){
  
  
                       }];   
  
  }
  
  
  
  -(void)viewDidLoad{
  
      NSLog(@"Inview");
  
  }
  
  /*
  // Only override drawRect: if you perform custom drawing.
  // An empty implementation adversely affects performance during animation.
  - (void)drawRect:(CGRect)rect
  {
      // Drawing code
  }
  */
  
  @end
  </code></pre>
  
  <p>And View.h</p>
  
  <pre><code>//  View.h
  //  GestrureonImageView
  //
  //  Created by Noman Khan on 8/24/12.
  //  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
  //
  
  #import &lt;UIKit/UIKit.h&gt;
  
  @interface View : UIView&lt;UIGestureRecognizerDelegate&gt;
  
  @end
  </code></pre>
  
  <p>This is ViewController.m class</p>
  
  <pre><code>//  ViewController.m
  //  GestrureonImageView
  //
  //  Created by Noman Khan on 8/24/12.
  //  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
  //
  
  #import "ViewController.h"
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  @synthesize v;
  
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
      if (self) {
          // Custom initialization
      }
      return self;
  }
  
  -(void) gesturesCallBack:(UITapGestureRecognizer *)sender 
  {
      NSLog(@"abc");
  
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      [self.view setBackgroundColor:[UIColor blueColor]];
  
      UITapGestureRecognizer *tapGestures=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gesturesCallBack:)];
  
     // NSLog(@"init gestures");
  
      [tapGestures setDelegate:self];
  
      // Set required taps and number of touches
      [tapGestures setNumberOfTapsRequired:1];
      [tapGestures setNumberOfTouchesRequired:1];
  
      [self.view addGestureRecognizer:tapGestures];
      v=[[View alloc]initWithFrame:CGRectMake(40, 50, 80, 50)];
      v.backgroundColor=[UIColor yellowColor];
  //    [v addGestureRecognizer:tapGestures];    
      [self.view addSubview:v];
  
  
      // Do any additional setup after loading the view.
  }
  
  - (void)viewDidUnload
  {
      [super viewDidUnload];
      // Release any retained subviews of the main view.
  }
  
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  {
      return (interfaceOrientation == UIInterfaceOrientationPortrait);
  }
  
  @end
  </code></pre>
  
  <p>this is my ViewController.h</p>
  
  <pre><code>//  ViewController.h
  //  GestrureonImageView
  //
  //  Created by Noman Khan on 8/24/12.
  //  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
  //
  
  #import &lt;UIKit/UIKit.h&gt;
  #import "View.h"
  
  @interface ViewController : UIViewController &lt;UIGestureRecognizerDelegate&gt;
  
  
  @property(nonatomic,strong)View *v;
  
  @end
  </code></pre>