Reputation: 67
I know it is possible to take screenshots inside your own app but I was wondering if it is possible to have an app that allows you to capture screenshots in any view as long as the app it open. Im pretty sure its not possible but I just wanted to double check. Thank you.
Upvotes: 1
Views: 410
Reputation: 432
- (IBAction)saveScreenshot {
// Define the dimensions of the screenshot you want to take (the entire screen in this case)
CGSize size = [[UIScreen mainScreen] bounds].size;
// Create the screenshot
UIGraphicsBeginImageContext(size);
// Put everything in the current view into the screenshot
[[self.view layer] renderInContext:UIGraphicsGetCurrentContext()];
// Save the current image context info into a UIImage
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
// Save the screenshot to the device's photo album
UIImageWriteToSavedPhotosAlbum(newImage, self,
@selector(image:didFinishSavingWithError:contextInfo:), nil);
}
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
if (error) {
// Handle if the image could not be saved to the photo album
}
else {
// The save was successful and all is well
}
}
Upvotes: 0
Reputation: 8339
In other words, you would like to spy on other apps. Like the user's banking information. Now that the question is rephrased, I'll bet you know the answer (and why it won't change even if you file a feature request).
Upvotes: 1
Reputation: 5940
Its an iOS default. If you press the Home + Power
button at the same time the iOS device will take a screenshot and store the screenshot in your photos app.
Upvotes: 2
Reputation: 29524
No, it's not possible to interact with other applications outside of your sandbox on iOS.
Upvotes: 6