Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extension UIImage {
- convenience init(view: UIView) {
- UIGraphicsBeginImageContext(view.frame.size)
- view.layer.render(in: UIGraphicsGetCurrentContext()!)
- let image = UIGraphicsGetImageFromCurrentImageContext()
- UIGraphicsEndImageContext()
- self.init(cgImage: (image?.cgImage)!)
- }
- }
Add Comment
Please, Sign In to add comment