Skip to content

Instantly share code, notes, and snippets.

@bogren
Last active August 29, 2015 14:00
Show Gist options
  • Save bogren/5b3fd8d1880876a6d113 to your computer and use it in GitHub Desktop.
Save bogren/5b3fd8d1880876a6d113 to your computer and use it in GitHub Desktop.
-(UIImage *)convertViewToImage
{
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view drawViewHierarchyInRect:self.view.bounds afterScreenUpdates:YES];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
- (void)doIt
{
UIImage* imageOfUnderlyingView = [self convertViewToImage];
imageOfUnderlyingView = [imageOfUnderlyingView applyBlurWithRadius:5
tintColor:[UIColor colorWithWhite:1.0 alpha:0.2]
saturationDeltaFactor:1.3
maskImage:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment