I have a CALayer that I just create and add to the subtitle of the main view of the controller of my view in the initWithNibName controller: And then I do the following animation:
[CATransaction begin]; [CATransaction setAnimationDuration:2]; [logoLayer setOpacity:0]; [CATransaction commit];
How can I find out when this animation is complete? performSelector: delayed for 2 seconds. the approach does not seem “right” for this.
According to doc [CATransaction setCompletionBlock:] can be used for what you want.
[CATransaction setCompletionBlock:]
It says
( ), , , ( ). , ( ), .
- begin .
begin
[CATransaction setCompletionBlock:^{ // Action after the animation completion }];