Skip to content

Instantly share code, notes, and snippets.

@zac
Last active August 29, 2015 13:57
Show Gist options
  • Save zac/9557808 to your computer and use it in GitHub Desktop.
Save zac/9557808 to your computer and use it in GitHub Desktop.
@interface UIView (QuickLookUtilities)
- (id)debugQuickLookObject;
@end
@implementation UIView (QuickLookUtilities)
- (id)debugQuickLookObject
{
UIGraphicsBeginImageContext(self.frame.size);
[self drawViewHierarchyInRect:(CGRect){ .size = self.frame.size } afterScreenUpdates:YES];
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return(theImage);
}
@end
@interface UIViewController (QuickLookUtilities)
@end
@implementation UIViewController (QuickLookUtilities)
- (id)debugQuickLookObject
{
return [self.view debugQuickLookObject];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment