I am inside a UIView subclass (CustomView in the code below).
I am drawing a border around an image in a UIImageView subclass (containerView). The Core Graphics code for this is located inside drawInRect:
in the subclass.
The Core Animation transition is a flip, however when it is drawn, the Core Graphics code is not used, i.e. drawInRect:
is not called to provide the CALayer with my rendered image.
Instead I get the animation from one image to the other without any Core Graphics drawing occurring.
How do I allow the CALayer to animate using my Core Graphics drawing rather than the raw image?
[CustomView beginAnimations:@"transitionNextImage" context:nil];
[CustomView setAnimationDuration:2.0];
[containerView setImage:image];
[CustomView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:containerView cache:YES];
[containerView setImage:differentImage];
[CustomView commitAnimations];