Skip to content

Instantly share code, notes, and snippets.

@3lvis
Forked from matthiasplappert/gist:9493050
Created March 13, 2014 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3lvis/9524479 to your computer and use it in GitHub Desktop.
Save 3lvis/9524479 to your computer and use it in GitHub Desktop.
@interface UIView (MPAdditions)
@end
@implementation UIView (MPAdditions)
- (id)debugQuickLookObject {
if (self.bounds.size.width < 0.0f || self.bounds.size.height < 0.0f) {
return nil;
}
UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, self.window.screen.scale);
[self drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment