Search code examples
iosuiimagepickercontrollerphotopreview

How to remove the "Preview" view after I take a picture in UIImagePickerController?


I'm using UIImagePickerController to take pictures. It's quite simple. But I have a problem: There is always a "Preview" view to let me "Retake" or "Use". Which is not what I want. I want to save my pictures straight away inside my photo albums.

I've found some articles about this problem, here are some of them:

Link 1

Link 2

Basically they are using a OverlayView which can solve the problem. But there is new problem. I can't use volume up key to take pictures anymore after I use OverlayView. Are there another solution to disable the stupid "Preview" ?

Thanks


Solution

  • You could access the camera directly and not use UIImagePickerController at all.

    Check out the following classes:
    AVCaptureSession
    AVCaptureDevice
    AVCaptureDeviceInput
    AVCaptureVideoDataOutput

    With these classes you can display your own camera preview and save the image when button is pressed. There is example here:
    http://developer.apple.com/library/ios/#qa/qa1702/_index.html