Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix delegate property type #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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