UITapGestureRecognizer *clickGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickGesture:)];
[cell addGestureRecognizer:clickGesture];
[clickGesture release];
-(void)clickGesture:(id)sender{
//获取点击位置
// NSLog(@"point.x: %f point.y : %f",point.x,point.y);
if (point.x < self.view.frame.size.width / 3) {
NSLog(@"point.x < 1/3");
}
else if(point.x > self.view.frame.size.width / 3 * 2){
NSLog(@"point.x > 2/3");
}
else{
NSLog(@"1/3 <point.x < 2/3");
}
//通过indexForRowAtPoint来获取点击所在的行数
NSIndexPath* indexPath = [_tableView indexPathForRowAtPoint:point];
NSLog(@"index row %d",indexPath.row)
}