I am wondering how my iPhone app can take a screen shot of a specific UIView as a UIImage.
UIView
UIImage
I tried this code but all I get is a blank image
There is new API from iOS 10
extension UIView { func makeScreenshot() -> UIImage { let renderer = UIGraphicsImageRenderer(bounds: self.bounds) return renderer.image { (context) in self.layer.render(in: context.cgContext) } } }