Created
January 8, 2012 09:03
-
-
Save kyleturner/1577785 to your computer and use it in GitHub Desktop.
CABasicAnimation opacity
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
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"opacity"]; | |
[animation setFromValue:[NSNumber numberWithFloat:1.0]]; | |
[animation setToValue:[NSNumber numberWithFloat:0.0]]; | |
[animation setDuration:0.5f]; | |
[animation setTimingFunction:[CAMediaTimingFunction | |
functionWithName:kCAMediaTimingFunctionLinear]]; | |
[animation setAutoreverses:YES]; | |
[animation setRepeatCount:20000]; | |
[[view layer] addAnimation:animation forKey:@"opacity"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment