title: How to add image overlay to UIImagePickerControllerSourceTypePhotoLibrary when editing?
body: <p>I've tried looking everywhere for an answer to this but can not find any useful info.</p>
  
  <p>Basically, I want the user to pick a picture from the album, and then have the app display the picture in the edit/crop mode. </p>
  
  <p>On this edit screen I want to display an overlay screen for the user to use to align his image.</p>
  
  <p>He then clicks the save button which saves the edited picture with the overlay image by just merging the images.</p>
  
  <p><strong>The only thing I can not find how to do is add the overlay image in the edit screen!</strong></p>
  
  <p>I can do this quite easily when: </p>
  
  <p><code>imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;</code></p>
  
  <p>But when: </p>
  
  <p><code>imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;</code> </p>
  
  <p>I can not use: </p>
  
  <p><code>imagePicker.cameraOverlayView = overlayGraphicView;</code></p>
  
  <p>and that is my issue.</p>
  
  <p>Also if I add an UIimage as a subview instead then this overlay, it stays on the screen even when the user is choosing his image from the album. I only want the overlay to appear after the image has been chosen for editing and before it has been saved to the album after the editing has finished.</p>
  
  <p>Thanks for your help.</p>
  
  <p>Heres the method:</p>
  
  <pre><code>- (IBAction)pickPhotoButton:(id)sender {
      NSLog(@"Pick a Current Photo Button Pressed...");
  
      // Create image picker controller
      UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
  
      // Set source to the camera
      imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
  
      // Delegate is self
      imagePicker.delegate = self;
  
      // Allow editing of image ?
      imagePicker.allowsEditing = YES;
  
      // Show image picker
      [self presentModalViewController:imagePicker animated:YES]; 
  }
  </code></pre>
  
  <p>and heres my save to album method:</p>
  
  <pre><code>// Save the image to photo album
  - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
  {    
      // Access the uncropped image from info dictionary
      UIImage *image = [info objectForKey:@"UIImagePickerControllerEditedImage"];
  
      // Combine image with overlay before saving!!
      image = [self addOverlayToImage:image];
  
      // Save image
      UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
  
      [picker release];
  }
  </code></pre>