UIGraphicsBeginImageContext(view.frame.size)

            view.layer.renderInContext(UIGraphicsGetCurrentContext()!)

            let image = UIGraphicsGetImageFromCurrentImageContext()

            UIGraphicsEndImageContext()