Created
August 26, 2014 07:23
-
-
Save Bayonetta/9b94da3c16f3891dd5f3 to your computer and use it in GitHub Desktop.
converter view to image
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
- (UIImage *)imageFromView:(UIView *)view { | |
UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, 0.0); | |
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO]; | |
UIImage * img = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return img; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment