I want to screenshot display out of my app when an event occurred. I read these links( 1, 2, 3) but they aren't for ios 10. I want to know if I can do this.
Thanks
extension UIView {
public func toImage () -> UIImage {
UIGraphicsBeginImageContextWithOptions(bounds.size, isOpaque, 0.0)
drawHierarchy(in: bounds, afterScreenUpdates: false)
let img = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return img!
}
}