I'm trying to animate backgroundcolor on a uilabel to achieve a 'fade' effect. My code looks like this:
UILabel *lbl = ...
UIColor *oldCol = lbl.backgroundColor;
lbl.backgroundColor = [UIColor blueColor];
[UIView animateWithDuration:1.0 animations:^(void) {
lbl.backgroundColor = oldCol;
}];
But it instantly reverts to the original colour. I also tried the below, to isolate the problem:
lbl.backgroundColor = [UIColor blueColor];
[UIView animateWithDuration:1.0 animations:^(void) {
lbl.backgroundColor = [UIColor greenColor];
}];
And it instantly goes to green. Any ideas?