It is very easy to create an animation and to destroy it when animation complete.
However, is there any good way to destroy the layer (newLayer) when animations inside the layer complete?
Code:
CALayer *newLayer=[CALayer layer];
CAKeyframeAnimation *animationSequence = [CAKeyframeAnimation animationWithKeyPath: @"contents];
animationSequence.removedOnCompletion = YES;
[newLayer addAnimation:animationSequence forKey:@"contents"];
[parentLayer addSublayer:newLayer];
However, is there any good way to destroy the layer (newLayer) when animations inside the layer complete?