Last active
August 29, 2015 14:00
-
-
Save bogren/5b3fd8d1880876a6d113 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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