iOS Getting a Screencapture of UIView Aasim Naseem, August 22, 2011March 12, 2024 Some times you have to capture a portion of you iPhone application programmatically; The quickest way is to pass the target view to following method and get its screenshot as an UIImage; [sourcecode language=”objc”] -(UIImage*)captureFullScreen:(UIView*) targetView{ UIGraphicsBeginImageContext(targetView.view.frame.size); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *fullScreenshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(fullScreenshot, nil, nil, nil); return fullScreenshot;… Continue Reading