//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;
}