Last active
August 12, 2018 18:24
-
-
Save nishabe/41b54634c9c89df419ac45ed0d5dbe94 to your computer and use it in GitHub Desktop.
OBJC: Pulsing View Animation
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)showPulsingAnimation { | |
CABasicAnimation *theAnimation; | |
theAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; | |
theAnimation.duration = 2.0; | |
theAnimation.repeatCount = HUGE_VALF; | |
theAnimation.autoreverses = YES; | |
theAnimation.fromValue = [NSNumber numberWithFloat:1.0]; | |
theAnimation.toValue = [NSNumber numberWithFloat:0.0]; | |
[self.pulsingView.layer addAnimation:theAnimation forKey:@"animateOpacity"]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment