Skip to content

Commit

Permalink
Add swipeTableCellWillBeginSwiping && swipeTableCellWillEndSwiping de…
Browse files Browse the repository at this point in the history
…legate methods
  • Loading branch information
MortimerGoro committed Jul 15, 2015
1 parent dd2f593 commit 4ed061d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions MGSwipeTableCell/MGSwipeTableCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ typedef NS_ENUM(NSInteger, MGSwipeExpansionLayout) {
**/
-(BOOL) swipeTableCell:(MGSwipeTableCell *)cell shouldHideSwipeOnTap:(CGPoint) point;

/**
* Called when the cell will begin swiping
* Useful to make cell changes that only are shown after the cell is swiped open
**/
-(void) swipeTableCellWillBeginSwiping:(MGSwipeTableCell *) cell;

/**
* Called when the cell will end swiping
**/
-(void) swipeTableCellWillEndSwiping:(MGSwipeTableCell *) cell;

@end


Expand Down
7 changes: 7 additions & 0 deletions MGSwipeTableCell/MGSwipeTableCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ - (void) showSwipeOverlayIfNeeded
self.selected = NO;
if (_swipeContentView)
[_swipeContentView removeFromSuperview];
if (_delegate && [_delegate respondsToSelector:@selector(swipeTableCellWillBeginSwiping:)]) {
[_delegate swipeTableCellWillBeginSwiping:self];
}
_swipeView.image = [self imageFromView:self];
_swipeOverlay.hidden = NO;
if (_swipeContentView)
Expand Down Expand Up @@ -644,6 +647,10 @@ -(void) hideSwipeOverlayIfNeeded
}
[self setAccesoryViewsHidden:NO];

if (_delegate && [_delegate respondsToSelector:@selector(swipeTableCellWillEndSwiping:)]) {
[_delegate swipeTableCellWillEndSwiping:self];
}

if (_tapRecognizer) {
[self removeGestureRecognizer:_tapRecognizer];
_tapRecognizer = nil;
Expand Down

0 comments on commit 4ed061d

Please sign in to comment.