I want an UITableViewCell (-background) to shortly light up in red and return to the old appearance again. This is done during the life of an NSTimer which is giving the constant impulse to invoke the animation.
Right now I am using UIView’s animateWithDuration:delay:options:animations:completion: method to first change the cells background color to red and then in the completion part to turn it gray again (the cell’s background is gray). But this solution doesn’t work smoothly for some reason.
QUESTION: Thinking of core animation, how would I best do this kind of animation for (a) an UITableVeiwCell and (b) an UIButton ?
Thanks for any help!
I was using an
NSTimerto trigger the animation over and over again. Somehow it was giving the above described side effects. Now I am using the block animation available sinceiOS4which is working much smoother. You have to combine the(UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse)options to repeat the Animation:The only side effect I experienced was that the animation stops when the cell goes off screen, which wasn’t the case with the
NSTimer.