Skip to content

Instantly share code, notes, and snippets.

@zoejessica
Created March 15, 2014 12:23
Show Gist options
  • Save zoejessica/9566337 to your computer and use it in GitHub Desktop.
Save zoejessica/9566337 to your computer and use it in GitHub Desktop.
Ben Scheirman's category on UIView to get quick look debugging on UIView variables (not just properties)
// http://benscheirman.com/2014/03/quick-look-debugging-with-uiview/
#import "UIView+DebugObject.h"
@implementation UIView (DebugObject)
- (id)debugQuickLookObject {
UIGraphicsBeginImageContext(self.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[self.layer renderInContext:context];
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