Friday 8 August 2014

ImageSelect to allow multiple selection in photo library via collection view interface.

Hi,
As I know , many people needs something that allow multiple  selection on iPhone Photo Library.
On lot of searching over net , I found some API that allow multiple selection on iPhone Photo Library.

But there were some disadvantages including memory warning , hanging problem etc. So to overcome this situation I introduced you a set of two files that will let you select multiple image at a time from Library.

How to Use Selector Files:-

1)First of all you need to add AssetsLibrary framework in your project.
2)Import ImageSelector.h file where ever you want to use it. And you need one more file that is check image.

  Add this image to your project and name it as check.png


3)Add its delegate as

@interface ViewController : UIViewController<ImageSelectorDelegate>
- (IBAction)select:(id)sender;
@end

 And use its delegate method in implementation file like UITableView.

4)Create object of ImageSelector File and set its delegate to self view-controller and present ImageSelector Object as modal view as given below:

    ImageSelector *selector = [[ImageSelector alloc] init];
    selector.ims_delegate = self;
    [self presentViewController:selector animated:YES completion:nil];
5)In its delegate method you will get selected Images from photo Library

-(void)ims_PickerController:(ImageSelector*)picker didFinishPickingMediaItems:(NSArray*)items
{
    [picker dismissViewControllerAnimated:YES completion:nil];

    for (UIImage *image in items) {
        NSLog(@"My Image %@\n",image);
    }
}

For File Ref ----------

ImageSelector.h

ImageSelector.m