Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you create a custom camera view, instead of UIImagePickerViewController?

I created a simple application using UIImagePickerViewController for capturing from the camera, but I'd like to customize the interface for grabbing from the camera, such as adding some buttons.

UIImagePickerViewController doesn't allow this directly, so how would you create a custom view that allows for displaying the live camera feed and capturing from it?

like image 844
CNSivakumar Avatar asked Mar 01 '11 15:03

CNSivakumar


People also ask

Why do we need Uiimagepickercontroller view controller what system interfaces it manages?

A view controller that manages the system interfaces for taking pictures, recording movies, and choosing items from the user's media library.

What is Iphone photo picker?

The system Photos picker is the best way for most apps to access photos and videos on iOS. The picker runs out of process, so your app doesn't need to request any library access to use it. It has an intuitive UI and an easy-to-use API.

What is photo picker?

The photo picker provides a browsable, searchable interface that presents the user with their media library, sorted by date from newest to oldest. This tool provides a safe, built-in way for users to select images and videos, without needing to grant your app access to their entire media library.


1 Answers

The easy way is to continue to use UIImagePickerViewController but set showsCameraControls to NO and provide your own user interface using cameraOverlayView.

The more difficult (but more flexible) way is to use the AVFoundation classes (particularly AVCaptureVideoPreviewLayer and AVCaptureStillImageOutput) to construct your own camera.

like image 173
Anomie Avatar answered Sep 21 '22 13:09

Anomie