I want to create a CALayer animation that gives sort of a \'flashy\' effect. For that I\'m trying to animate the \'opacity\' property, but my problem is that I have no idea wher
Trojanfoe's answer is excellent. I just want to add that if you want more control over the "timeline" (how long should it take to fade out? how long should we then wait? then how long should it take to fade in? and so on) you're going to want to combine multiple CABasicAnimation
s into a CAAnimationGroup.
You might want to read my book chapter on this topic, the last part of which constitutes a tutorial on CAAnimation and its offspring:
http://www.apeth.com/iOSBook/ch17.html#_core_animation
Note that my discussion is directed at iOS; on Mac OS X, if that's where you are, the view/layer architecture is a little different, but what it says about CAAnimation is still correct.