Ничего себе, на самом деле ни один из этих ответов не работает. Вот как вы делаете это, чтобы получить скриншот всего, включая контроллер навигации
-(void) takeScreenshot
{
CGRect screenRect = [[UIScreen mainScreen] bounds];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
{
//its iphone
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480 || result.width == 480)
{
// iPhone Classic
screenRect = CGRectMake(0, 0, 320, 480);
}
if(result.height == 568 || result.width == 568)
{
// iPhone 5
screenRect = CGRectMake(0, 0, 320, 568);
}
}
else
{
//its pad
screenRect = CGRectMake(0, 0, 768, 1024);
}
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* documentsDirectory = [paths objectAtIndex:0];
// This code is for high resolution screenshot
UIGraphicsBeginImageContextWithOptions(screenRect.size, NO, 0.0);
//this was pre iOS 7.0
//[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
// iOS 7.x -->
[[[[UIApplication sharedApplication] windows] objectAtIndex:0] drawViewHierarchyInRect:self.view.bounds afterScreenUpdates:YES]; // Set To YES
UIImage *viewImage2 = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData* imageData2 = UIImageJPEGRepresentation(viewImage2, 1.0);
NSString* incrementedImgStr2 = [NSString stringWithFormat: @"UserScreenShotPic.jpg"];
// Now we get the full path to the file
NSString* fullPathToFile3 = [documentsDirectory stringByAppendingPathComponent:incrementedImgStr2];
[imageData2 writeToFile:fullPathToFile3 atomically:NO];
}