// // LDTableView.m // YouHuiProject // // Created by xiaoxi on 2018/1/17. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LDTableView.h" @implementation LDTableView - (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style { self = [super initWithFrame:frame style:style]; if (self) { self.delaysContentTouches = NO; self.canCancelContentTouches = YES; self.separatorStyle = UITableViewCellSeparatorStyleNone; self.backgroundView.backgroundColor = [UIColor clearColor]; self.backgroundColor = [UIColor clearColor]; UIView *wrapView = self.subviews.firstObject; if (wrapView && [NSStringFromClass(wrapView.class) hasSuffix:@"WrapperView"]) { for (UIGestureRecognizer *gesture in wrapView.gestureRecognizers) { if ([NSStringFromClass(gesture.class) containsString:@"DelayedTouchesBegan"]) { gesture.enabled = NO; break; } } } } return self; } - (BOOL)touchesShouldCancelInContentView:(UIView *)view { if ([view isKindOfClass:[UIControl class]]) { return YES; } return [super touchesShouldCancelInContentView:view]; } /** 同时识别多个手势 @param gestureRecognizer gestureRecognizer description @param otherGestureRecognizer otherGestureRecognizer description @return return value description */ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { return NO; } @end