Search code examples
iosobjective-ccameraios-camera

How to take several images from Camera ios


I`m making one implementation for take photo from camera and select photo from library.

For take photos from library i`m using ELCImagePickerController and setting the images in a scrollview.

What i want to do is take several images from Camera and setting this on the same scroll view.

Current my implementation is:

- (IBAction)takePhoto:(UIButton *)sender {

        UIImagePickerController *cameraPicker = [[UIImagePickerController alloc] init];
        cameraPicker.delegate = self;
        cameraPicker.allowsEditing = YES;
        cameraPicker.sourceType = UIImagePickerControllerSourceTypeCamera;

        [self presentViewController:cameraPicker animated:YES completion:NULL];
}

- (void)imagePickerController:(UIImagePickerController *)photoPicker didFinishPickingMediaWithInfo:(NSDictionary *)info {

        [photoPicker dismissViewControllerAnimated:YES completion:NULL];
        UIImage *image=[info objectForKey:UIImagePickerControllerEditedImage];
        UIImageView *imageview = [[UIImageView alloc] initWithImage:image];
        [imageview setContentMode:UIViewContentModeScaleAspectFit];

        [self.scrollView addSubview:imageview];
        [self dismissModalViewControllerAnimated:YES];
}

With this i just can take one photo per time and when i set this again it replace the other one. How can i take serveral? and how i supose do that?


Solution

  • First,I want say Thanks to Fahri Azimov, him comment on my Question but he dont asnwer it. I found the solution on CocoaControls .

    There I found one Application doing what I was looking for.

    RPMultipleImagePicker

    What I had to do Add the controllers,models and resources from RPMultipleImagePicker. Import it on my Controller. Then change some things in Image Picker for add in my on ScrollView.