Ios – Animating UIButton text color

animationiosuibutton

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.

Best Answer

Use transition with view

[UIView transitionWithView:backButton
                          duration:0.5f
                           options:UIViewAnimationOptionTransitionCrossDissolve
                        animations:^{
                            [backButton setTitleColor:[_peacock lighten:d.primary] forState:UIControlStateNormal];
                        }
                        completion:^(BOOL finished){
                        }];