title: Problems using UIPanGestureRecognizer in UITableViewCell
body: <p>I'm trying to implement a UIPanGestureRecognizer in my UITableViewController to use for a swipe to delete animation. Similar to the swipe to delete used in the Clear app, where if you swipe a UITableViewCell in left or right the cell moves and gets deleted. </p>
  
  <p>I have tried implementing this in my UITableViewCell subclass but it never seems to receive the event. </p>
  
  <p>This is the code I put in my UITableViewCell subclass to try this functionality. In my init method</p>
  
  <pre><code>UIGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
      recognizer.delegate = self;
      [self addGestureRecognizer:recognizer];
  </code></pre>
  
  <p>and then the methods to handle it:</p>
  
  <pre><code>- (BOOL)gestureRecognizerShouldBegin:(UIPanGestureRecognizer *)gestureRecognizer {
  CGPoint translation = [gestureRecognizer translationInView:self.superview];
  //might have to change view to tableView
  //check for the horizontal gesture
  if (fabsf(translation.x) &gt; fabsf(translation.y)) {
      return YES;
      NSLog(@"Panning");
  }
  return NO;
  }
  
  - (void)handlePan:(UIPanGestureRecognizer *)recognizer {
  if (recognizer.state == UIGestureRecognizerStateBegan) {
      //if the gesture has just started record the center location
      NSLog(@"handlePan");
      _originalCenter = self.center; //Declared as a CGPoint at the top of my TableViewCell
  }
  
  if (recognizer.state == UIGestureRecognizerStateChanged) {
      //translate the center (aka translate from the center of the cell)
      CGPoint translation = [recognizer translationInView:self];
      self.center = CGPointMake(_originalCenter.x + translation.x, _originalCenter.y);
      // determine whether the item has been dragged far enough to delete/complete
  
  }
  
  if (recognizer.state == UIGestureRecognizerStateEnded) {
      // the frame this cell would have had before being dragged
      CGRect originalFrame = CGRectMake(0, self.frame.origin.y, self.bounds.origin.x, self.bounds.size.height);
      [UIView animateWithDuration:0.2 animations:^{
          self.frame = originalFrame;}
       ];
  }
  }
  </code></pre>
  
  <p>The Cells don't move at all though. Not really sure what's going on here</p>