Skip to content

Instantly share code, notes, and snippets.

@jparishy
Created August 9, 2011 21:09
Show Gist options
  • Save jparishy/1135204 to your computer and use it in GitHub Desktop.
Save jparishy/1135204 to your computer and use it in GitHub Desktop.
completion:^(BOOL finished)
{
// Get a UIImage of the contents of the view as they are now
float scale = [[UIScreen mainScreen] scale];
UIGraphicsBeginImageContextWithOptions(self.view.superview.frame.size, true, scale);
CGContextRef imageContext = UIGraphicsGetCurrentContext();
[self.view.superview.layer renderInContext:imageContext];
UIImage* image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment