Skip to content

Instantly share code, notes, and snippets.

@phatduckk
Created March 13, 2014 22:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phatduckk/9538695 to your computer and use it in GitHub Desktop.
Save phatduckk/9538695 to your computer and use it in GitHub Desktop.
- (UIImage *)screenshotBlurred {
UIImage *blurItemImage = [self.screenshot stackBlur:25];
return blurItemImage;
}
- (UIImage *)screenshot {
CGRect rect = [self bounds];
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[self.layer renderInContext:context];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImage *uiImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:1.0 orientation:UIImageOrientationUp];
return [uiImage normalize];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment