How do I draw a layer without a transaction animation? For example, when I set the contents of a layer using CATransaction
it works well:
[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue
forKey:kCATransactionDisableActions];
myLayer.contents = (id)[[imagesTop objectAtIndex:Number]CGImage];
[CATransaction commit];
but I need to change contents from the delegate method [myLayer setNeedsDisplay]
. Here is the code:
-(void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context
{
CGContextDrawImage(context, rect, Image.CGImage]);
}