mirror of
https://github.com/zhigang1992/HHPanningTableViewCell.git
synced 2026-01-12 09:04:24 +08:00
Merge pull request #8 from jklp/master
Added property where user can set the minimum panning distance
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user