I have a CALayer that implements drawInContext: and draws a simple circle, like so:
- (void)drawInContext:(CGContextRef)ctx
{
CGContextScaleCTM(ctx, DrawingScale, DrawingScale);
CGContextSetRGBFillColor (ctx, 1, 0, 0, 1);
CGContextFillEllipseInRect (ctx, LocationRectangle);
}
I have been experimenting with different ways of increasing the size of my circle based on a touch event. I've tried using the UIView beginAnimation system and CABasicAnimation's, bbut they all blur the image. In my reading I have discovered that is because the CALayer's seem to be treated like bitmaps for these options.
Fair enough... but I want to scale my graphics without blurring, e.g. to use vector scaling.
As such, in my code I have a "DrawingScale" property.
Is there a neat way to scale this property using Layer animations? Or is this something people do with NSTimers (yuk)?
Might this be one situation where I can use Core Animation's ability to animate custom properties? If so, I'd love to know which example people find is the best, or which section of the Apple docs might be a good place to start with this topic.
It seems when it comes to graphics on Mac/iOS, there are many ways to skin/draw a cat...?