Found here: How do I take a full screen Screenshot in Swift?
func getScreenshot() -> UIImage {
var window: UIWindow? = UIApplication.shared.keyWindow
window = UIApplication.shared.windows[0] as? UIWindow
UIGraphicsBeginImageContextWithOptions(window!.frame.size, window!.isOpaque, 0.0)
window!.layer.render(in: UIGraphicsGetCurrentContext()!)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image!
}
My image includes much stuff of text on a page in DIN A4-format. The quality of the image is very poor for printing it. Is there any chance to increase the resolution?
The best way would be to save the screenshot as pdf. Is there any help here to save and refind the image.pdf in my device.
Thx for any hint.