I have just created a new photo album with this code:
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^
{
//Checks for App Photo Album and creates it if it doesn't exist
PHFetchOptions *fetchOptions = [PHFetchOptions new];
fetchOptions.predicate = [NSPredicate predicateWithFormat:@"title == %@", @"ChameleonSensors"];
PHFetchResult *fetchResult = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:fetchOptions];
if (fetchResult.count == 0)
{
//Create Album
PHAssetCollectionChangeRequest *albumRequest = [PHAssetCollectionChangeRequest creationRequestForAssetCollectionWithTitle:@"ChameleonSensors"];
}
}
completionHandler:^(BOOL success, NSError *error)
{
NSLog(@"Log here...");
if (!success) {
NSLog(@"Error creating album: %@", error);
}else{
NSLog(@"Perfecto");
}
}];
This is ok, but now I need to save photos in this photo album.
I´m using objective-c and photo framework.
thank you