I'm trying to add a 'pulsing' effect (scale in/out) to a label following this:
ios - how to do a native "Pulse effect" animation on a UIButton
But I am receiving the following error in XCode:
No visible @interface for 'UILabel' declares the selector 'addAnimation:forKey:'
The code (.h):
IBOutlet UILabel *SecondsLabel;
The code (.m):
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.scale"];
theAnimation.duration=1.0;
theAnimation.repeatCount=HUGE_VALF;
theAnimation.autoreverses=YES;
theAnimation.fromValue=[NSNumber numberWithFloat:1.0];
theAnimation.toValue=[NSNumber numberWithFloat:0.0];
[SecondsLabel addAnimation:theAnimation forKey:@"transform.scale"];