UIPanGestureRecognizer *panGesture = (UIPanGestureRecognizer*)gestureRecognizer;
pan.delegate = (id<UIGestureRecognizerDelegate>)self;
然后在self里面实现以下代理
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
if ([otherGestureRecognizer.view isKindOfClass:[UITableView class]]) {
return YES;
}
return NO;
}