1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- //
- // DRTableView.m
- // YouHuiProject
- //
- // Created by xiaoxi on 2018/1/17.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "DRTableView.h"
- @implementation DRTableView
- - (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
|