Created
May 16, 2013 08:05
-
-
Save bleft/5590171 to your computer and use it in GitHub Desktop.
pulsing animation.
Put two UIImageViews on a view for low and highlighted. Animate the highlighted for pulsing. To stop animation remove animation from layer. Needs QuartzCore.Framework.
This file contains hidden or 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)startAnimation | |
{ | |
self.imageViewHigh.hidden = NO; | |
CABasicAnimation *theAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; | |
theAnimation.duration = 1.0f; | |
theAnimation.repeatCount = HUGE_VALF; | |
theAnimation.autoreverses = YES; | |
theAnimation.fromValue = [NSNumber numberWithFloat:0.0f]; | |
theAnimation.toValue = [NSNumber numberWithFloat:1.0f]; | |
[self.imageViewHigh.layer addAnimation:theAnimation forKey:@"animateOpacity"]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment