I am placing two CAGradientLayers on a UIButton, and then changing the layers depending on whether the button is highlighted or not (finger down).
The problem is that it takes a fraction of a second for the gradient to change. At first it faded, i fixed that by clearing all animations on the layer.
Both gradients are created beforehand, and on touchDown the highlight gradient gets it hidden-variable set to FALSE, which i think should be instant? What have i missed? Is there a perhaps better way to accomplish this?
The purpose of the code is to create buttons like the Login button showed here:

Try calling
updateControlStatefrom UIButton’ssetHighlightedmethod instead of thetouchUp: andtouchDown.setHighlightedshould be getting called automatically when touch events occur. I’ve done a button withCAGradientLayerslike that before, and it may be faster than what your getting now.