Merge pull request #8 from jklp/master

Added property where user can set the minimum panning distance
This commit is contained in:
Pierre Bernard
2013-02-22 12:41:46 -08:00
2 changed files with 5 additions and 1 deletions

View File

@@ -48,6 +48,7 @@ typedef enum {
@property (nonatomic, assign) NSInteger directionMask;
@property (nonatomic, assign) BOOL shouldBounce;
@property (nonatomic, assign) CGFloat minimumPan;
@property (nonatomic, weak) id<HHPanningTableViewCellDelegate> delegate;
- (BOOL)isDrawerRevealed;

View File

@@ -85,6 +85,9 @@ static HHPanningTableViewCellDirection HHOppositeDirection(HHPanningTableViewCel
if (self != nil) {
[self panningTableViewCellInit];
}
// Note, minimum pan distance can be overridden
self.minimumPan = HH_PANNING_MINIMUM_PAN;
return self;
}
@@ -437,7 +440,7 @@ static HHPanningTableViewCellDirection HHOppositeDirection(HHPanningTableViewCel
CGFloat totalPanX = translation.x;
if (!self.panning) {
if (fabsf(totalPanX) <= HH_PANNING_MINIMUM_PAN) {
if (fabsf(totalPanX) <= self.minimumPan) {
totalPanX = 0.0f;
}
else {