I've got this UIView which is backed by a CATiledLayer. My setup works pretty smooth at the moment but the horror starts when I want to animate certain view objects on this CATiledLayer.
I've read that I can force the CATiledLayer to redraw itself by using setNeedsDisplay
. But this actually redraws everything on the screen. So all the tiles are loaded all over again.
How should I update my layer when something is animating? Let's take the following as an example: I've got 6 green rectangles on my layer and when I press a UIButton I'd like to change the color of rectangle number 4 to red and reposition rectangle 1 2 and 3 on a bezier curve.
you can use CATiledView:setNeedsDisplayInRect: to radraw only portions of the layer.
in your case you should: