Created
March 15, 2014 12:23
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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