diff --git a/SWTableViewCell/PodFiles/SWCellScrollView.h b/SWTableViewCell/PodFiles/SWCellScrollView.h index 50fe75b..6eb8104 100644 --- a/SWTableViewCell/PodFiles/SWCellScrollView.h +++ b/SWTableViewCell/PodFiles/SWCellScrollView.h @@ -9,5 +9,5 @@ #import @interface SWCellScrollView : UIScrollView - +@property (assign, nonatomic) BOOL panDisabled; @end diff --git a/SWTableViewCell/PodFiles/SWCellScrollView.m b/SWTableViewCell/PodFiles/SWCellScrollView.m index 56b394a..6aaa8a5 100644 --- a/SWTableViewCell/PodFiles/SWCellScrollView.m +++ b/SWTableViewCell/PodFiles/SWCellScrollView.m @@ -13,6 +13,9 @@ @implementation SWCellScrollView - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { if (gestureRecognizer == self.panGestureRecognizer) { + if (self.panDisabled) { + return NO; + } CGPoint translation = [(UIPanGestureRecognizer*)gestureRecognizer translationInView:gestureRecognizer.view]; return fabs(translation.y) <= fabs(translation.x); } else { diff --git a/SWTableViewCell/PodFiles/SWTableViewCell.h b/SWTableViewCell/PodFiles/SWTableViewCell.h index 10d9fab..b434c00 100644 --- a/SWTableViewCell/PodFiles/SWTableViewCell.h +++ b/SWTableViewCell/PodFiles/SWTableViewCell.h @@ -37,6 +37,7 @@ typedef NS_ENUM(NSInteger, SWCellState) @interface SWTableViewCell : UITableViewCell +@property (nonatomic, assign) BOOL swipeDisabled; @property (nonatomic, copy) NSArray *leftUtilityButtons; @property (nonatomic, copy) NSArray *rightUtilityButtons; diff --git a/SWTableViewCell/PodFiles/SWTableViewCell.m b/SWTableViewCell/PodFiles/SWTableViewCell.m index 3daceac..1fd65a8 100644 --- a/SWTableViewCell/PodFiles/SWTableViewCell.m +++ b/SWTableViewCell/PodFiles/SWTableViewCell.m @@ -24,7 +24,7 @@ @interface SWTableViewCell ()