With the release of iOS 8.0, there is no need to get an image and blur it more. As Andrew Plummer noted, you can use UIVisualEffectView with UIBlurEffect .
UIViewController * contributeViewController = [[UIViewController alloc] init]; UIBlurEffect * blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; UIVisualEffectView *beView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; beView.frame = self.view.bounds; contributeViewController.view.frame = self.view.bounds; contributeViewController.view.backgroundColor = [UIColor clearColor]; [contributeViewController.view insertSubview:beView atIndex:0]; contributeViewController.modalPresentationStyle = UIModalPresentationOverCurrentContext; [self presentViewController:contributeViewController animated:YES completion:nil];
Solution that works up to iOS 8
I would like to dwell on rckoenes answer:
As already emphasized, you can create this effect:
- Convert base UIView to UIImage
- UIImage Blur
- Set UIImage as the background of your view.

Sounds like a lot of work, but actually performed pretty straight forward:
1. Create a UIView category and add the following method:
-(UIImage *)convertViewToImage { UIGraphicsBeginImageContext(self.bounds.size); [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return image; }
2. Make an image of the current view and grease it using the Apple Image Effect ( download ) category
UIImage* imageOfUnderlyingView = [self.view convertViewToImage]; imageOfUnderlyingView = [imageOfUnderlyingView applyBlurWithRadius:20 tintColor:[UIColor colorWithWhite:1.0 alpha:0.2] saturationDeltaFactor:1.3 maskImage:nil];
3. Set it as the background of your overlay.
-(void)viewDidLoad { self.view.backgroundColor = [UIColor clearColor]; UIImageView* backView = [[UIImageView alloc] initWithFrame:self.view.frame]; backView.image = imageOfUnderlyingView; backView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.6]; [self.view addSubview:backView]; }
Sebastian Hojas Mar 04 '14 at 20:08 2014-03-04 20:08
source share