Created
October 29, 2016 02:51
-
-
Save HarrisHan/b0cc76faaa9410146f961d4c81aa6360 to your computer and use it in GitHub Desktop.
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 characters
@implementation UIView (ScreenShot) | |
- (UIImage *)apo_screenshotImage | |
{ | |
UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, 0.0); | |
[self drawViewHierarchyInRect:self.bounds afterScreenUpdates:NO]; | |
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