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
3 changes: 2 additions & 1 deletion UIView+Shake.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ typedef enum : NSUInteger {
SCShakeOptionsAtEndRestart = 256,
SCShakeOptionsAtEndComplete = 512,
SCShakeOptionsAtEndContinue = 1024,
SCShakeOptionsAutoreverse = 2048
SCShakeOptionsAutoreverse = 2048,
SCShakeOptionAllowsUserInteraction = 4096

} SCShakeOptions;

Expand Down
3 changes: 2 additions & 1 deletion UIView+Shake.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ - (void)_doAnimation:(CGFloat)direction {
CGFloat force = shakeInfo.force * interpolationRatio * direction;
CGFloat iterationDuration = shakeInfo.iterationDuration;

[UIView animateWithDuration:iterationDuration animations:^{
UIViewAnimationOptions animationOptions = HAS_OPT(options, SCShakeOptionAllowsUserInteraction) ? UIViewAnimationOptionAllowUserInteraction : 0;
[UIView animateWithDuration:iterationDuration delay:0 options:animationOptions animations:^{
[self _animate:force shakeInfo:shakeInfo];
} completion:^(BOOL finished) {
if (shakeInfo.shaking) {
Expand Down