I'm trying to making a kind of color pulse effect animating background color of a UIButton
to make it change continously from a color (WhiteColor) to another one (RedColor).
I'm trying to use CABasicAnimation
for changing Opacity but I can't make it work with color too.
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"opacity"];
theAnimation.duration=1.0;
theAnimation.repeatCount=HUGE_VALF;
theAnimation.autoreverses=YES;
theAnimation.fromValue=[NSNumber numberWithFloat:1.0];
theAnimation.toValue=[NSNumber numberWithFloat:0.0];
[BigButton.layer addAnimation:theAnimation forKey:@"animateOpacity"];
Every suggestion would be appreciated. Thanks