I am using a UIWebView to display HTML formatted text. I am not loading a webpage, just supplying a string of HTML to the UIWebView.
Now I want to animate this UIWe
I could be wrong but if you set the cache param of CoreAnimation the OS will handle this optimisation for you.
e.g.
[UIView setAnimationTransition:transition forView:self.view cache:YES];
UIGraphicsBeginImageContext(webview.bounds.size);
[webview.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
You might run into issues if the webview dimensions are large because the webview uses a CATiledLayer
that doesn't draw everything for memory reasons.
The image will include transparency