diff --git a/UIView+Shake.h b/UIView+Shake.h index 84f3dc4..647b409 100644 --- a/UIView+Shake.h +++ b/UIView+Shake.h @@ -26,7 +26,8 @@ typedef enum : NSUInteger { SCShakeOptionsAtEndRestart = 256, SCShakeOptionsAtEndComplete = 512, SCShakeOptionsAtEndContinue = 1024, - SCShakeOptionsAutoreverse = 2048 + SCShakeOptionsAutoreverse = 2048, + SCShakeOptionAllowsUserInteraction = 4096 } SCShakeOptions; diff --git a/UIView+Shake.m b/UIView+Shake.m index afa7568..80c103d 100644 --- a/UIView+Shake.m +++ b/UIView+Shake.m @@ -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) {