title: pan gesture of UIImageView interfers the scroll
body: <p>I want to implement the functionality of pan gesture to a imageview, this imageview is a subview of a scroll view. the problem is when i try to scroll the scrollview the pan gesture of the imageview gets recognized, and the scrollview does not scroll.
  please help me with this.</p>
  
  <p>this is the code for initializing the pan to the uiimageview:</p>
  
  <pre><code>UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(move:)];
              [panRecognizer setMinimumNumberOfTouches:1];
              [panRecognizer setMaximumNumberOfTouches:1];
              [panRecognizer setDelegate:self];
              [[[scrollView subviews] objectAtIndex:i] addGestureRecognizer:panRecognizer];
  </code></pre>
  
  <p>the imageview has the user set to "YES"</p>
  
  <p>and the action for it</p>
  
  <pre><code>-(void)move:(UIPanGestureRecognizer *)sender
  {
      [[[[[sender view] superview] superview] superview]  bringSubviewToFront:sender.view];
  
  
      if([(UIPanGestureRecognizer*)sender state] == UIGestureRecognizerStateBegan) {
  
          if ([[[sender view] superview] superview] == itemView) // adds the imageview in the item scroll
          {
              int tag = [[sender view] tag] / 100;
              UIScrollView *tempScroll = (UIScrollView *)[itemView viewWithTag:-tag];
              CGRect frame = CGRectFromString([itemFrameDict objectForKey:[NSString stringWithFormat:@"%i",[[sender view] tag]]]);
  
              CGAffineTransform transform = temp.transform;
              UIImageView *tempImageView =  [[UIImageView alloc] initWithImage: [(UIImageView *) [sender view] image]];
              tempImageView.tag = [[sender view] tag];
              //NSLog(@"[sender view] superview] : %@", [[sender view] superview]);
              tempImageView.frame = frame;
              [tempImageView setTransform:transform];
              [tempImageView setFrame:frame];
              [tempImageView setUserInteractionEnabled:YES];
              [tempScroll addSubview:tempImageView];
  
              UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(move:)];
              [panRecognizer setMinimumNumberOfTouches:1];
              [panRecognizer setMaximumNumberOfTouches:1];
              [panRecognizer setDelegate:self];
              [tempImageView addGestureRecognizer:panRecognizer];
  
              UITapGestureRecognizer *singleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
              [singleTapGestureRecognizer setNumberOfTapsRequired:1];
              [tempImageView addGestureRecognizer:singleTapGestureRecognizer];
          }
      }
  
      if([(UIPanGestureRecognizer*)sender state] == UIGestureRecognizerStateChanged)
      {
          CGPoint translatedPoint = [sender locationInView:[[sender view] superview]] ;
          newTranslatedPoint = [[[sender view] superview] convertPoint:translatedPoint toView:self.view];
  
          if ([sender view].frame.size.width == 35 &amp;&amp; [sender view].frame.size.height == 35)
              [[sender view] sizeToFit];
  
          [sender view].center =  CGPointMake(newTranslatedPoint.x, newTranslatedPoint.y); //startFrame;
  
          [self.view addSubview:[sender view]];
      }
  
      if([(UIPanGestureRecognizer*)sender state] == UIGestureRecognizerStateEnded)
      {
          CGPoint newPoint = [[[sender view] superview] convertPoint:newTranslatedPoint toView:itemView];
          if (newPoint.y &lt; 0)// || !viewUp)
          {
              //NSLog(@" baseView");
              [baseView addSubview:[sender view]];
  
              UITapGestureRecognizer *doubleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];
              [doubleTapGestureRecognizer setNumberOfTapsRequired:2];
              [[sender view] addGestureRecognizer:doubleTapGestureRecognizer];
  
              UIPinchGestureRecognizer *pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(scale:)];
              [pinchRecognizer setDelegate:self];
              [[sender view] addGestureRecognizer:pinchRecognizer];
  
              UIRotationGestureRecognizer *rotationRecognizer = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotate:)];
              [rotationRecognizer setDelegate:self];
              [[sender view] addGestureRecognizer:rotationRecognizer];
          }
  
          else if (newPoint.y &gt; 0)// &amp;&amp; viewUp )
          {
              //NSLog(@" itemView");
              int tag = [[sender view] tag] / 100;
              UIScrollView *tempScroll = (UIScrollView *)[itemView viewWithTag:-tag];
              CGRect frame = CGRectFromString([itemFrameDict objectForKey:[NSString stringWithFormat:@"%i",[[sender view] tag]]]);
  
              CGAffineTransform transform = temp.transform;
              [[sender view] setTransform:transform];
              [[sender view] setFrame:frame];
              [tempScroll addSubview:[sender view]];
          }
      }
  }
  </code></pre>