Created
October 7, 2016 06:43
-
-
Save mcany/c6135133e0d1c8874b8c3d60e2d56775 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)pulseAnimationTo:(UIView *)view duration:(float)duration toValue:(float)toValue repeatCount:(float)repeatCount { | |
CABasicAnimation *pulseAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; | |
pulseAnimation.duration = duration; | |
pulseAnimation.toValue = [NSNumber numberWithFloat:toValue]; | |
pulseAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; | |
pulseAnimation.autoreverses = YES; | |
pulseAnimation.repeatCount = repeatCount; | |
[view.layer addAnimation:pulseAnimation forKey:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment