I found this , but I have not tried it myself.
Here you will find the used -renderInContext .
I converted the code above to a category on a UIView. name it like this: [aView saveScreenshotToPhotosAlbum];
#import <QuartzCore/QuartzCore.h> - (UIImage*)captureView { CGRect rect = [[UIScreen mainScreen] bounds]; UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); [self.layer renderInContext:context]; UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return img; } - (void)saveScreenshotToPhotosAlbum { UIImageWriteToSavedPhotosAlbum([self captureView], nil, nil, nil); }
vikingosegundo
source share