Is there a way to animate the textColor property of a UIButton? I've found some solutions for UILabel text color animation, but haven't seen any for UIButton.
Use transition with view
[UIView transitionWithView:backButton
duration:0.5f
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
[backButton setTitleColor:[_peacock lighten:d.primary] forState:UIControlStateNormal];
}
completion:^(BOOL finished){
}];
NSTimer is absolutely no good as an animation tool, nor should it be used for timekeeping in general where precision is needed (frame rate). This blog post perfectly exemplifies my position on what to do about non-animateable UILabel properties, which should be sent off to the render server through CA, not an NSTimer. Instead of UILabel, you can use or wrap CATextLayer and animate it's foregroundColor
property in the standard animation block.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With