func imageWithView(targetView : UIView) -> UIImage?{
UIGraphicsBeginImageContext(targetView.bounds.size);
targetView.layer.render(in: UIGraphicsGetCurrentContext()!)
let image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image
}