iOS solves the conflict between tableView and click gestures

//Accept gesture proxy

<UIGestureRecognizerDelegate>

//add gesture

   UITapGestureRecognizer *tap = [[UITapGestureRecognizeralloc]initWithTarget:selfaction:@selector(showOrHidenBar)];

    tap.delegate=self;

    [self.viewaddGestureRecognizer:tap];

/**

 * Judging that if the click is the cell of the tableView, the closing gesture is not turned on by clicking the cell gesture

 **/

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {


    NSLog(@"View === %@",touch.view);

    if ([NSStringFromClass([touch.viewclass])isEqualToString:@"UITableViewCellContentView"]) {

        NSLog(@"UITableView");

        return NO;

    }

    

    NSLog(@"View");

    return YES;

}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325567616&siteId=291194637