Skip to content

Commit 678edf4

Browse files
committed
Added a delegate that exposes the scroll state of the cell. This is needed to animate or customize the look of the buttons/views based on how far along the user has swiped away the cell.
1 parent 87cdea0 commit 678edf4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

SWTableViewCell/PodFiles/SWTableViewCell.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ typedef NS_ENUM(NSInteger, SWCellState)
3131
- (BOOL)swipeableTableViewCellShouldHideUtilityButtonsOnSwipe:(SWTableViewCell *)cell;
3232
- (BOOL)swipeableTableViewCell:(SWTableViewCell *)cell canSwipeToState:(SWCellState)state;
3333
- (void)swipeableTableViewCellDidEndScrolling:(SWTableViewCell *)cell;
34+
- (void)swipeableTableViewCell:(SWTableViewCell *)cell didScroll:(UIScrollView *)scrollView;
3435

3536
@end
3637

SWTableViewCell/PodFiles/SWTableViewCell.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,10 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView
748748
}
749749

750750
[self updateCellState];
751+
752+
if (self.delegate && [self.delegate respondsToSelector:@selector(swipeableTableViewCell:didScroll:)]) {
753+
[self.delegate swipeableTableViewCell:self didScroll:scrollView];
754+
}
751755
}
752756

753757
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView

0 commit comments

Comments
 (0)