views:

14

answers:

0

I'm taking a snapshot of an view. This view has got some subviews which have layer masks applied to them. For some reason, those masks take no effect in the snapshot and the masked parts are completely visible.

UIGraphicsBeginImageContext(theView.frame.size);
[theView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

I assume this is a bug in the framework. But maybe it's not? Did I do anything wrong here?

The documentation states that this is not good for masked layers. So: Is there any alternative?