I have a CALayer that implements drawInContext: and draws a simple circle, for example:
- (void)drawInContext:(CGContextRef)ctx
{
CGContextScaleCTM(ctx, DrawingScale, DrawingScale);
CGContextSetRGBFillColor (ctx, 1, 0, 0, 1);
CGContextFillEllipseInRect (ctx, LocationRectangle);
}
I experimented with different ways to increase the size of my circle based on a touch event. I tried using beginAnimation UIView and CABasicAnimation, but they all blur the image. In my reading, I found that this is because CALayer seems to be processing as bitmap images for these parameters.
Fair enough ... but I want to scale my graphics without blur, for example. to use vector scaling.
So in my code, I have the DrawingScale property.
Is there a neat way to scale this property with the Layer animation? Or is this what people do with NSTimers (yuk)?
Perhaps this is one of the situations where I can use the Core Animation ability to animate custom properties? If so, I would like to know what example people find, is it the best, or which section of Apple's documents can be a good place to start this topic.
It seems that when it comes to graphics on Mac / iOS, there are many ways to throw / draw a cat ...?
source
share