- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
UITouch* touch = [[event allTouches] anyObject];
CGPoint leftLocation = [touch locationInView: self.contentView];
CGPoint tapLoccation = [touch locationInView: self.tapView];
if ([self.contentView pointInside:leftLocation withEvent:event])
{
if ([self.tapView pointInside:tapLoccation withEvent:event]) {
self.touchLeft =NO;
[super touchesBegan:touches withEvent:event];
} else {
self.touchLeft = YES;
[super touchesBegan:touches withEvent:event];
}
} else {
self.touchLeft = NO;
[super touchesBegan:touches withEvent:event];
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
VCCollectionCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
if (cell.touchLeft) {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
} else {
[tableView deselectRowAtIndexPath:indexPath animated:NO];
[self tableView:self.tableView accessoryButtonTappedForRowWithIndexPath:indexPath];
}
}