Why are all my masked views unmasked in my view snapshot?
- by mystify
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?