How to make this kind of effect in iOS, blur effect it is increasing leaner to lower side

Solutions Collect From Internet About “How to make this kind of effect in iOS, blur effect it is increasing leaner to lower side”

Use CAGradientLayer

UIColor *theColor = [[UIColor alloc] initWithRed:146.0/255.0 green:146.0/255.0 blue:146.0/255.0 alpha:1];

CAGradientLayer *gradientLayer = [CAGradientLayer layer];

CGRect gradientLayerFrame = theView.frame;
gradientLayerFrame.origin.x = 0;
gradientLayerFrame.origin.y = 0;
gradientLayer.frame = gradientLayerFrame;

//build the colors array for the gradient
NSArray *colors = [NSArray arrayWithObjects:
                   (id)[theColor CGColor],
                   (id)[[theColor colorWithAlphaComponent:0.9f] CGColor],
                   (id)[[theColor colorWithAlphaComponent:0.6f] CGColor],
                   (id)[[theColor colorWithAlphaComponent:0.4f] CGColor],
                   (id)[[theColor colorWithAlphaComponent:0.3f] CGColor],
                   (id)[[theColor colorWithAlphaComponent:0.1f] CGColor],
                   (id)[[UIColor clearColor] CGColor],
                   nil];

gradientLayer.colors = colors;

[yourView.layer insertSublayer:gradientLayer atIndex:0];

swift version of this code is here