I'm trying to animate the drawing of a circle. Something the Shazaam app is doing while recording, but much simpler.
I've got this code in the drawRect: method to draw the circle:
CGContextRef currentContext = UIGraphicsGetCurrentContext();
CGContextSetRGBStrokeColor(currentContext, 0.86, 0.86, 0.86, 1.0);
CGContextSetLineWidth(currentContext, kLineWidth);
CGContextStrokeEllipseInRect(currentContext, CGRectMake(0.0, 0.0, 150.0, 150.0));
I tried to animate the circle with:
[CATransaction begin];
[CATransaction setValue:[NSNumber numberWithFloat: 3.0f] forKey: kCATransactionAnimationDuration];
// Drawing code above
[CATransaction commit];
The only thing it does is draw the circle as stated, but it's not animated.
Can anyone help me with this?