Arbitur
Arbitur

Reputation: 39081

Is it possible to save an image ONLY to a custom album in iOS6?

I want to save a image captured with AVCaptureStillimageOutput and I'm trying to save it using this code :

[self.library writeImageToSavedPhotosAlbum:image metadata:nil completionBlock:nil]:

it's by default saving to PhotoRoll and there is no option to change album.

I found an older guide o how to save image to album using this code:

[self.library saveImage:img toAlbum:albumName withCompletionBlock:^(NSError *error) {
    if (error!=nil) {
        NSLog(@"Big error: %@", [error description]);
    }
}];

but it seems to be deprecated... Is it possible to make it nondeprecated because i think that this method is the one I'm looking for.

Upvotes: 1

Views: 1013

Answers (1)

ceekay
ceekay

Reputation: 1157

All photos go to the SavedPhotos. Once you saved it there you can use the library method addAssetsGroupAlbumWithName:resultBlock:failureBlock:

and then the ALAssetsGroup method addAsset:

Please see this answer for more detail: Create, Delete, and add pictures to albums in the photos app?

Upvotes: 1

Related Questions