-1

I am not sure that Apple allows this kind of stuff. I just want to make an application to take a screen capture whatever app is open on the iPhone not only the current application. Please suggest any solutions.

Dave Barker
  • 155
  • 1
  • 7
kalpesh
  • 1,285
  • 1
  • 17
  • 30

4 Answers4

0

No, afraid not. Due to sandboxing, you only have access to your own app's window.

Dave Barker
  • 155
  • 1
  • 7
0

You can't capture screen of another applications or windows rather then your application. It's restricted by apple.

You can capture your application's screen by using UIGraphicsBeginImageContextWithOptions. for that you can refer this so post.

Community
  • 1
  • 1
Ketan Parmar
  • 27,092
  • 9
  • 50
  • 75
0

You can find all information about background tasks here: https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html But I don't think, that Apple will allow you to take screenshots of other apps, as it could lead to security problems.

Ilya V.
  • 106
  • 6
-2

You can't capture other applications screen except your own application. Here is the code to take screen shot of the view

class Welcome: UIViewController {

       if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, NO, [UIScreen mainScreen].scale);
else
       UIGraphicsBeginImageContext(self.view.bounds.size);

       [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
       UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
       UIGraphicsEndImageContext();

       UIImageWriteToSavedPhotosAlbum(image, self, nil, nil);

}
Tharif
  • 13,794
  • 9
  • 55
  • 77