Before iOS7 I use UIGetScreenImage()
function to take the screenshot easily, but in iOS7, it becomes deprecated, now are there any good methods to archive this?Than
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
This code can help you in getting a screenshot of the self.view which is whole of the screen of the iPhone no matter which app is in front.If you have used any layers in your view then the layers will not be included in the screenshot and for that you have to use self.view.layer.