发布于 2017-05-20 17:22:57
扩展UIView {
public func toImage () -> UIImage {
UIGraphicsBeginImageContextWithOptions(bounds.size, isOpaque, 0.0)
drawHierarchy(in: bounds, afterScreenUpdates: false)
let img = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return img!
}}
https://stackoverflow.com/questions/44083837
复制相似问题