/RPMultipleImagePicker

iOS Multiple image picker from camera using UIImagePickerController (whatsapp like)

Primary LanguageObjective-CMIT LicenseMIT

RPMultipleImagePicker

Select multiple images from camera using UIImagePickerController and RPMultipleImagePicker.

RPMultipleImagePicker preview

Requirements

  • iOS 6.1+* (not tested on iPad)
  • MobileCoreServices.framework
  • QuartzCore.framework

How to use

Include the files from 'Classes' folder in your project.

Initialize RPMultipleImagePicker and set the source type.

RPMultipleImagePickerViewController *multipleImagePicker = [[RPMultipleImagePickerViewController alloc] init];
multipleImagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; // or UIImagePickerControllerSourceTypePhotoLibrary if you are using iPhone emulator

Set selected image and show the RPMultipleImagePicker after the Image Picker View finish.

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    
    NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
    UIImage *selectedImage;
    
    if (CFStringCompare ((CFStringRef) mediaType, kUTTypeImage, 0) == kCFCompareEqualTo) {
        
        selectedImage = (UIImage *) [info objectForKey: UIImagePickerControllerOriginalImage];
        
        // Add image to RPMultipleImagePickerViewController
        [self.multipleImagePicker addImage:selectedImage];
        
        // RPMultipleImagePicker Done callback
        self.multipleImagePicker.doneCallback = ^(NSArray *images) {
            
            // Get the images
            
        };
        
        // Show RPMultipleImagePickerViewController
        [picker pushViewController:self.multipleImagePicker animated:YES];
        
    }
}

Take a look at the 'Example' folder for an example project.

Maintainers

License

RPMultipleImagePicker is released under the MIT license. See LICENSE for details.