Looks like you need to wrap the background color setter in an explicit CATransaction
, because it's not getting flushed until after you add the animation.
Like so:
[CATransaction begin];
// set background
[CATransaction flush];
[CATransaction commit];