简体   繁体   中英

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.

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM