I want to save image in gallery in specific folder.
When i click save i am using this code to save image
- (IBAction)saveImageToGallery:(id)sender {
NSLog(@"SaveImageToGallery");
/*
-----------------------------------------------------------------------
THis will hide button and take screen shot then will show buttons again
-----------------------------------------------------------------------
*/
[AddImagesToCanvasView setHidden:YES];
[ShareOnCanvas setHidden:YES];
[CanvasButtonForRatio setHidden:YES];
for(UIButton *b in self.view.subviews) {
if([b isKindOfClass:[UIButton class]]) {
b.hidden = YES;
}
}
UIGraphicsBeginImageContext(self.view.frame.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
for(UIButton *b in self.view.subviews) {
if([b isKindOfClass:[UIButton class]]) {
b.hidden = NO;
}
}
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
}
i want that when i click save than it open photos so i can create new album or click on existing album and save that image in that album.
How will i do that.
Is this possible?
You can use the foolowing code to save the image to specific Album.
Here image is your
UIImage.Make sure to include AssetsLibrary framework and
#import <AssetsLibrary/AssetsLibrary.h>Please refer this tutorial.