I have a CAGradientLayer that I want to scale as the user drags there finger. However, when I set the frame, the layer animates to the new size. This happens with other properties, too, including start/endPoint.
Here’s an example:
_gradient.frame = CGRectMake(0, 480-toHeight, 320, toHeight);
Yet, if I only call this when the user has dragged 10 or so pixels, the layer doesn’t simply jump to the new size, it animates in a smooth but quick eased animation. I’m positive this isn’t called in an animation block. To further debug, I also animate the frame of a UIView in the same scope and that doesn’t animate.
I’m new to CALayers, so maybe I’m doing something way wrong.
Most of CALayer’s properties are animated by default. You need to disable these implicit animations:
Here is a good sample to help you with learning Core Animation.