I have masked an image like this:
UIView *maskImage; maskImage = [[UIView alloc] init];
maskImage.backgroundColor = UIColorFromRGB(FTRMaskColor);
maskImage.frame = newFrame;
CALayer *theLayer = [CALayer layer];
theLayer.contents = (id)[[UIImage imageNamed:@"image.png"] CGImage];
theLayer.frame = newFrame;
maskImage.layer.mask = theLayer;
It works fine but the main problem is if I want to rotate the my Ipad, the rotation animation of the view or the layer (I'm not very sure) doesn't work. It rotates without animation. Could you help, please?
use CA3Daffinetransform to rotate
To rotate a
CALayer
:myRotationAngle
should be in radians. Use negative values for counter-clockwise rotation and positive values for clockwise.