I want to take screenshots of the iPhone app view and save the images to a given location.
My code below saves the images to the photo library, but I want to save it to some other given location. Is it possible to do so? Please help me up.
My code is here:
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, self, nil, nil);
You can use NSData to store the image data.
To save the image:
To retrieve the image:
Update #1: Example (I can't test the example right now but it should work this way):