diff --git a/SWTableViewCell/PodFiles/SWTableViewCell.h b/SWTableViewCell/PodFiles/SWTableViewCell.h index 10d9fab..b7c3035 100644 --- a/SWTableViewCell/PodFiles/SWTableViewCell.h +++ b/SWTableViewCell/PodFiles/SWTableViewCell.h @@ -32,6 +32,7 @@ typedef NS_ENUM(NSInteger, SWCellState) - (BOOL)swipeableTableViewCell:(SWTableViewCell *)cell canSwipeToState:(SWCellState)state; - (void)swipeableTableViewCellDidEndScrolling:(SWTableViewCell *)cell; - (void)swipeableTableViewCell:(SWTableViewCell *)cell didScroll:(UIScrollView *)scrollView; +- (void)swipeableTableViewCellDidSelected:(SWTableViewCell *)cell; @end diff --git a/SWTableViewCell/PodFiles/SWTableViewCell.m b/SWTableViewCell/PodFiles/SWTableViewCell.m index 3daceac..ff6fdf7 100644 --- a/SWTableViewCell/PodFiles/SWTableViewCell.m +++ b/SWTableViewCell/PodFiles/SWTableViewCell.m @@ -176,6 +176,17 @@ - (void)initializer [NSLayoutConstraint constraintWithItem:buttonView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationLessThanOrEqual toItem:self.contentView attribute:NSLayoutAttributeWidth multiplier:1.0 constant:-kUtilityButtonWidthDefault], ]]; } + + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapedInsideCell)]; + tap.cancelsTouchesInView = NO; + [self.cellScrollView addGestureRecognizer:tap]; +} + +- (void) tapedInsideCell +{ + if ( _cellState == kCellStateCenter) { + [ _delegate swipeableTableViewCellDidSelected:self]; + } } static NSString * const kTableViewPanState = @"state";