Created
January 31, 2018 07:42
-
-
Save maciejpiotrowski89/275cc42dbb66bb668f89aef483161881 to your computer and use it in GitHub Desktop.
Draw UIImage from UIView
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
| - (UIImage *)image { | |
| UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, 0.0); | |
| [self.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
| UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); | |
| UIGraphicsEndImageContext(); | |
| return image; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment