title: AVfoundation save photo to custom album iOS 8
body: <p>I have created a custom camera with <code>AVfoundation</code> framework (objective C) and I am saving photos using </p>
  
  <pre><code>UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
  </code></pre>
  
  <p>But it just saves to default camera album. I want to save my photos in a custom album, but <code>ALAssetsLibrary</code> or ALAssetsLibrary+CustomPhotoAlbum.h is not working with <code>iOS8</code> any more. I have tried every thing but nothing works in <code>iOS8</code>.</p>
  
  <p>So the following does not work :</p>
  
  <pre><code>[self.library saveImage:image toAlbum:@"CustomAlbum" withCompletionBlock:^(NSError *error) {
          if (error!=nil) {
              NSLog(@"Big error: %@", [error description]);
          }
      }];
  </code></pre>
  
  <p>Could you please help me save photo to custom album in <code>iOS8</code>?</p>
  
  <p>Thank you a lot.</p>
  
  <p>The following methods does not work inside ALAssetsLibrary+CustomPhotoAlbum ,in <code>iOS8</code>, class:</p>
  
  <pre><code>-(void)saveImage:(UIImage*)image toAlbum:(NSString*)albumName withCompletionBlock:(SaveImageCompletion)completionBlock
  {
      //write the image data to the assets library (camera roll)
      [self writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)image.imageOrientation 
                          completionBlock:^(NSURL* assetURL, NSError* error) {
  
                            //error handling
                            if (error!=nil) {
                                completionBlock(error);
                                return;
                            }
  
                            //add the asset to the custom photo album
                            [self addAssetURL: assetURL 
                                      toAlbum:albumName 
                          withCompletionBlock:completionBlock];
  
                        }];
  }
  </code></pre>