Animar el color de fondo de UIButton de WhiteColor a RedColor
Estoy tratando de hacer una especie de efecto de pulso de color animando el color de fondo de unUIButton
para que cambie continuamente de un color (WhiteColor) a otro (RedColor). Estoy tratando de usarCABasicAnimation
para cambiar la opacidad, pero tampoco puedo hacer que funcione con el color.
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"];
Toda sugerencia sería apreciada. Gracias