title: Drag and drop within UIScrollView
body: <p>I am trying to design a view which contains a list of items to be ordered and placed into an array.  The items are dynamically generated and thus cold be an amount that goes off the bottom of the screen.</p>
  
  <p>For this reason my first view is a <code>UIScrollview</code> which takes the whole devices screen
  Nested under this I have a label, explaining what the list is for and how to interact with it and then a <code>UITableView</code> with drag &amp; drop with the delegate methods from <a href="http://b2cloud.com.au/how-to-guides/reordering-a-uitableviewcell-from-any-touch-point" rel="nofollow">http://b2cloud.com.au/how-to-guides/reordering-a-uitableviewcell-from-any-touch-point</a></p>
  
  <p>The problem I am facing is that while the script works great when there are 1 or two rows, when the contentsize of the <code>UIscrollview</code> is larger than the screen it seems to take priority over the drag &amp; drop leading to unpredictable behaviour.</p>
  
  <p>Is there any way to make clicks on the table take priority to only edit the cells and allow the user to scroll by interacting elsewhere on the view?</p>
  
  <p>Thanks</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Based on the comment below I managed to get:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  //
  //
  //
  
  UIPanGestureRecognizer *tapGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(wasPanned:)];
      [self.view addGestureRecognizer:tapGesture];
  }
  -(void)wasPanned:(UIPanGestureRecognizer *)gesture
  {
      CGPoint point = [gesture locationInView:scrollView];
      UIView *isTable = [scrollView hitTest:point withEvent:nil];
      if (gesture.state == UIGestureRecognizerStateBegan)
      {
          if([[[isTable class] description] isEqualToString:@"UITableViewCellReorderControl"])
          {
              NSLog(@"Dragged from within table");
              [scrollView setScrollEnabled: NO];
  
          }
          else
          {
              [scrollView setScrollEnabled:YES];
          }
      }
      else{
          [scrollView setScrollEnabled:YES];
      }
  }
  </code></pre>
  
  <p>Now, when the scrollview is not long enough to begin scrolling it NSLogs the message fine
  However when the scrollview is longer it only recognises the gesture if the scrollview hasn't began scrolling first</p>
  
  <p><strong>Update</strong></p>
  
  <p>I now have the Console recognising touches in the table 100% of the time and disable scrolling.  Disabling the scrolling however also stops the drag &amp; drop functionality.  Does anyone know why?</p>
  
  <p>Extra code:</p>
  
  <pre><code>tapGesture.delegate = self;
  
  #pragma mark UIGestureRecognizerDelegate
  -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
  {
      return YES;
  }
  </code></pre>