Last active
August 29, 2015 13:57
-
Star
(103)
You must be signed in to star a gist -
Fork
(3)
You must be signed in to fork a gist
-
-
Save matthiasplappert/9493050 to your computer and use it in GitHub Desktop.
Revisions
-
matthiasplappert revised this gist
Mar 11, 2014 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,13 +4,12 @@ @interface UIView (MPAdditions) @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(); -
matthiasplappert revised this gist
Mar 11, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,9 @@ @implementation UIView (MPAdditions) - (id)debugQuickLookObject { CGSize size = self.bounds.size; if (size.width < 0.0f || size.height < 0.0f) { return nil; } UIGraphicsBeginImageContextWithOptions(size, NO, self.window.screen.scale); [self drawViewHierarchyInRect:CGRectMake(0.0f, 0.0f, size.width, size.height) afterScreenUpdates:YES]; -
matthiasplappert created this gist
Mar 11, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ @interface UIView (MPAdditions) @end @implementation UIView (MPAdditions) - (id)debugQuickLookObject { CGSize size = self.bounds.size; UIGraphicsBeginImageContextWithOptions(size, NO, self.window.screen.scale); [self drawViewHierarchyInRect:CGRectMake(0.0f, 0.0f, size.width, size.height) afterScreenUpdates:YES]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return image; } @end