I have a UIView with multiple subviews, each of these subviews having different CATransform3D applied to their layer. I want to create a UIImage representation of this view.
I have investigated the following solutions:
- UIGetScreenImage (private API, so that's a no-go)
- Taking the layer and calling renderInContext as described by Apple here: http://developer.apple.com/library/ios/#qa/qa1703/_index.html. This method does not respect the layer transform, and the views are drawn normally.
- Using glReadPixels as described here: When glReadPixels can be used?. This does not seem to be an option when dealing with UIViews.
- Generating a transformed image using the technique described by Marcos https://stackoverflow.com/a/13850972/368674 which led to images tearing beyond recognition. I followed it up by trying hfossli's improved version (https://stackoverflow.com/a/16203572/368674) which properly transformed most images, distorted or failed others, and gave the image an aliased effect.
Are there any other avenues I might explore in order to achieve this?