Circular CAGradientLayer Mask - iOS
I'm using CAGradientLayer on my image. I use this code to do this: UIImage *image = [UIImage imageNamed:@"perfect.jpg"]; [testImage setImage:image]; CAGradientLayer *myLayer = [CAGradientLayer layer]; myLayer.anchorPoint = CGPointZero; //starts in bottom left myLayer.startPoint = CGPointMake(1.0f,1.0f); //ends in top right myLayer.endPoint = CGPointMake(1.0f, 0.0f); UIColor *outerColor = [UIColor colorWithWhite:1.0 alpha:0.0]; UIColor *innerColor = [UIColor colorWithWhite:1.0 alpha:1.0]; //an array of colors that dictatates the gradient(s) myLayer.colors = @[(id)outerColor.CGColor, (id