Saving in photos using QuartzCore framework
A logic that lets you save your view as image to your saved photos. Here are the steps to follow:
1. Add QuartzCore framework.
2. Add IBAction in your header.
- (IBAction)fooView;
3. In your implementation add your IBAction similar to your header file.
- (IBAction)fooView {
UIGraphicsBeginImageContext(self.view.bounds.size) ;
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
4. Lastly make sure to call #import
