Skip to content

Commit

Permalink
Merge branch 'selection' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro committed Jul 12, 2015
2 parents 71c9160 + c36bb77 commit 9839fc4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions MGSwipeTableCell/MGSwipeTableCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ typedef NS_ENUM(NSInteger, MGSwipeExpansionLayout) {
@property (nonatomic) BOOL allowsButtonsWithDifferentWidth;
//default is YES. Controls wheter swipe gesture is allowed when the touch starts into the swiped buttons
@property (nonatomic) BOOL allowsSwipeWhenTappingButtons;
// default is NO. Controls whether the cell selection/highlight status is preserved when expansion occurs
@property (nonatomic) BOOL preservesSelectionStatus;

/** Optional background color for swipe overlay. If not set, its inferred automatically from the cell contentView */
@property (nonatomic, strong) UIColor * swipeBackgroundColor;
Expand Down
7 changes: 5 additions & 2 deletions MGSwipeTableCell/MGSwipeTableCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ -(void) initViews: (BOOL) cleanButtons
_swipeState = MGSwipeStateNone;
_triggerStateChanges = YES;
_allowsSwipeWhenTappingButtons = YES;
_preservesSelectionStatus = NO;
}

-(void) cleanViews
Expand Down Expand Up @@ -578,7 +579,8 @@ - (void) showSwipeOverlayIfNeeded
}
_overlayEnabled = YES;

self.selected = NO;
if (!_preservesSelectionStatus)
self.selected = NO;
if (_swipeContentView)
[_swipeContentView removeFromSuperview];
_swipeView.image = [self imageFromView:self];
Expand Down Expand Up @@ -983,7 +985,8 @@ -(void) panHandler: (UIPanGestureRecognizer *)gesture
CGPoint current = [gesture translationInView:self];

if (gesture.state == UIGestureRecognizerStateBegan) {
self.highlighted = NO;
if (!_preservesSelectionStatus)
self.highlighted = NO;
[self createSwipeViewIfNeeded];
_panStartPoint = current;
_panStartOffset = _swipeOffset;
Expand Down

0 comments on commit 9839fc4

Please sign in to comment.