將view 轉換成圖像
// 將某個view 轉換成圖像 class func getImageFromView(view:UIView) ->UIImage{ UIGraphicsBeginImageContext(view.bounds.size) view.layer.render(in: UIGraphicsGetCurrentContext()!) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return image! }