virtplay
virtplay

Reputation: 578

How to add photos to photo library in IOS 8 using Photos framework

I was using AlAsset library before, now for more info iam using Photos framework, I am able to get the photos and its info, but how to add to photo album back.

Upvotes: 3

Views: 3424

Answers (2)

Karan Alangat
Karan Alangat

Reputation: 2224

try this

[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
        [PHAssetChangeRequest creationRequestForAssetFromImage:[info valueForKey:UIImagePickerControllerOriginalImage]];
    } completionHandler:^(BOOL success, NSError *error) {
        if (success) {
             NSLog(@"Success");
        }
        else {
            NSLog(@"write error : %@",error);
        }
    }];

Check this answer, >> https://stackoverflow.com/a/31694088/2226263

Upvotes: 3

Daniel
Daniel

Reputation: 23359

You create and use PHAssetChangeRequest objects within a photo library change block to create, delete, or modify PHAsset objects. See Documentation

Also check out this answer.

Upvotes: 1

Related Questions