Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion MCSwipeTableViewCell/MCSwipeTableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ typedef void (^MCSwipeCompletionBlock)(MCSwipeTableViewCell *cell, MCSwipeTableV
@interface MCSwipeTableViewCell : UITableViewCell

/** Delegate of `MCSwipeTableViewCell` */
@property (nonatomic, assign) id <MCSwipeTableViewCellDelegate> delegate;
@property (nonatomic, weak) id <MCSwipeTableViewCellDelegate> delegate;

/**
* Damping of the physical spring animation. Expressed in percent.
Expand Down Expand Up @@ -179,6 +179,11 @@ typedef void (^MCSwipeCompletionBlock)(MCSwipeTableViewCell *cell, MCSwipeTableV
*/
- (void)triggerState1;

/**
* Trigger state 1 as if the user had swiped and released, and specify the animation duration
*/
- (void)triggerState1WithDuration:(NSTimeInterval)duration;

@end


Expand Down
6 changes: 5 additions & 1 deletion MCSwipeTableViewCell/MCSwipeTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,11 @@ - (void)swipeToOriginWithCompletion:(void(^)(void))completion {
#pragma mark - Trigger Manually

- (void)triggerState1 {
[UIView animateWithDuration:0.15f animations:^{
[self triggerState1WithDuration:0.15];
}

- (void)triggerState1WithDuration:(NSTimeInterval)duration {
[UIView animateWithDuration:duration animations:^{
[self animateSliderWithXTranslation:-70.f animationDuration:0 hasEnded:NO];
} completion:^(BOOL finished) {
[self animateSliderWithXTranslation:0.f animationDuration:0 hasEnded:YES];
Expand Down