I am trying to apply this animation to a UIBarButtonItem:
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.5]; [plusbutton.layer addAnimation:theAnimation forKey:@"animateOpacity"];
but I get an error in the header of the last line of code. How can I access the barbuttonItem layer?
source share