I have a UIImageView placed over a view and I want to capture iPhone screen while that UIImageView is animating.
I can successfully capture the screen shots of the still frames of the UIImageView like this:
[[myView layer] renderInContext:context];
However when the UIImageView is animating throguh
[MyImageView startAnimating]
then, those animating frames are not captured.
Is there any alternative to renderInContext available at the moment that can capture the animating frames as well?
NOTE: I know UIGetScreenImage() is no longer accepted by Apple after iOS4 update.
CALayers use a presentationLayer to represent the current state of the layer while animating.
CALayer‘s-presentationLayermethod returns you the presentation layer. So you might want to try[[[myView layer] presentationLayer] renderInContext:context];to capture its contents.