Skip to content

Instantly share code, notes, and snippets.

@heyfluke
Created October 5, 2013 09:12
Show Gist options
  • Save heyfluke/6838646 to your computer and use it in GitHub Desktop.
Save heyfluke/6838646 to your computer and use it in GitHub Desktop.
take snapshot.
. + (UIImage *)renderView:(UIView *)view {
. UIGraphicsBeginImageContext(view.bounds.size);
.
. CGContextRef ctx = UIGraphicsGetCurrentContext();
. [view.layer renderInContext:ctx];
.
. UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
.
. UIGraphicsEndImageContext();
.
. return newImage;
. }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment