Skip to content

Commit

Permalink
Improve property name
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro committed Mar 20, 2016
1 parent 5249fe6 commit ba63128
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions MGSwipeTableCell/MGSwipeTableCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ typedef NS_ENUM(NSInteger, MGSwipeEasingFunction) {
/** If true the table cell is not swiped, just the buttons **/
@property (nonatomic, assign) BOOL onlySwipeButtons;

/** If true the swipe bounces will be disabled, the swipe motion will stop right after the button */
@property (nonatomic, assign) BOOL disableSwipeBounces;
/** If NO the swipe bounces will be disabled, the swipe motion will stop right after the button */
@property (nonatomic, assign) BOOL enableSwipeBounces;

@end

Expand Down
10 changes: 5 additions & 5 deletions MGSwipeTableCell/MGSwipeTableCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ -(instancetype) init
self.threshold = 0.5;
self.offset = 0;
self.keepButtonsSwiped = YES;
self.disableSwipeBounces = NO;
self.enableSwipeBounces = YES;
self.showAnimation = [[MGSwipeAnimation alloc] init];
self.hideAnimation = [[MGSwipeAnimation alloc] init];
self.stretchAnimation = [[MGSwipeAnimation alloc] init];
Expand Down Expand Up @@ -962,12 +962,12 @@ - (void)setSwipeOffset:(CGFloat) newOffset;
MGSwipeButtonsView * activeButtons = sign < 0 ? _rightView : _leftView;
MGSwipeSettings * activeSettings = sign < 0 ? _rightSwipeSettings : _leftSwipeSettings;

if(activeSettings.disableSwipeBounces) {
CGFloat maxOffset = sign * activeButtons.bounds.size.width;
_swipeOffset = sign > 0 ? MIN(newOffset, maxOffset) : MAX(newOffset, maxOffset);
if(activeSettings.enableSwipeBounces) {
_swipeOffset = newOffset;
}
else {
_swipeOffset = newOffset;
CGFloat maxOffset = sign * activeButtons.bounds.size.width;
_swipeOffset = sign > 0 ? MIN(newOffset, maxOffset) : MAX(newOffset, maxOffset);
}
CGFloat offset = fabs(_swipeOffset);

Expand Down

0 comments on commit ba63128

Please sign in to comment.