CameraRoll Button using UIImagePickerControllerSourceTypeCamera? - ios

I want my camera ui will have the regular Camera Roll button. The one that you have when you open the camera app. Is there a simple way doing that or I'll have to use a custom layer? Tried searching in the documentation without success.

There is not an easy way to do it. You should implement your own custom toolbar to replicate the camera app behavior. You should use the overlay view property of the imagePicker. Have a look at this link for a possible implementation

Related

How to disable rear/front camera switching option in UIImagePickerController?

I am building an app to capture image(video) using UIImagePickerController. As my requirement is concerned I want to disable only the Rear/Front camera switching control. I tried the following code,
showsCameraControls=NO;
But it cancels all the controls like focus, flash. Can anyone suggest any solutions to disable rear/front switching control in UIImagePicker?
If you want the users to use the front camera. You can set cameraDevice to UIImagePickerControllerCameraDeviceFront. If you want to hide it, you must customize the overlay view by yourself.
There are two ways to do this.
You can hide the flip camera button by adding an overlay(UIView) on top of the button.
You can use a third party library for camera like NBUCamera where you can switch toggle camera control
Feel free to suggest edits to make this better
You can not hide only camera filp button in UIImagePickerController but you can use below library for customize camera controll
https://github.com/omergul123/LLSimpleCamera

UIImagePickerController with Custom Overlay and Edit Image

I am taking picture using UIImagePickerController with custom overlay view. I have a requirement to enable native editing mode of UIImagePickerController when photo is taken and user taps "Edit" button which is on my custom overlay view.
I have set:
imagePickerController.showsCameraControls = NO;
How is this possible to achieve?
Thanks,
You might be trying using UIImagePickerController. But I know this one solution to your problem. You can do it easily using AVCamCaptureManager and AVCamRecorder classes. Apple has a demo program build on its developer site here. It is named AVCam. In simple words what it does is when you click to open the camera, it calls the classes and methods which are responsible for opening the iPhone's camera and record video or capture audio. It calls the same classes which are called by UIImagePickerController. So your camera will open and start taking input.
Now, if you open the xib file of that AVCam project, you'll find a small UIView object. This view is responsible for displaying the camera's feed. You can resize that view as per the size you want and the camera's input will be displayed in that much area. You can also put the frame image around it as per your choice.
It worked for me when I wanted to resize the camera's input feed and capture photos. I hope it works for you as well.

iOS: UIImagePicker or AVCam for this functionality

I am looking for a way to add a custom button on camera preview and don't know where to go. Just like the iOS native camera, on the left of the capture button, you can click on it and access photo library. How can we add a button to the camera preview view? Would anyone be kind enough to give some directions? Thanks in advance.
Take a look at UIImagePickerController's cameraOverlayView. This lets you lay your own interface on top of the default camera interface.
Check out this sample project. It shows the preview of the camera in a custom UIView and uses AVCaptureSession for the management of the video preview. You can add whatever you want in the custom UIView as you like.

UIImagePickerController avoiding the use/retry view after picture taken without disabling other controls

I'd like to avoid the use/retry view after the picture is taken without disabling the default Apple camera controls that let me take the picture.
Doing this:
imagePicker.showsCameraControls = NO;
Causes ALL the camera controls to disappear. Is there any other method?
Unfortunately there is no proper way to do this provided by Apple. So here are you options:
showCameraControls = NO and adding your own controls.
go hardcore and use AVFoundation - but again you'll need your own controls - probably not what you're looking to do but if you're interested I have a sample app of this here:
https://github.com/Shein/CameraFeedUnderlay
Hack around it - place YOUR OWN button on top of camera control play button and override the action to take the picture as you would without camera controls and directly dismiss the UIImagePickerController.
There's a sort-of example of this solution here:
iPhone SDK - How to disable the picture preview in UIImagePickerController?
Perhaps this helps. You can use imagePicker.showsCameraControls = YES; in collaboration with NSNotificationCenter listening to #"_UIImagePickerControllerUserDidCaptureItem" and #"_UIImagePickerControllerUserDidRejectItem".
When entering the #"_UIImagePickerControllerUserDidCaptureItem" state, you could then dismiss the UIImagePickerController.
I had a similar problem, hiding a overlay when entering the preview view. I could solve the problem with this approach.
You can customize an image picker controller to manage user interactions yourself. To do this, provide an overlay view containing the controls you want to display, and use the methods described in “Capturing Still Images or Movies.” You can display your custom overlay view in addition to, or instead of, the default controls. Custom overlay views for the UIImagePickerController class are available in iOS 3.1 and later by way of the cameraOverlayView property. For a code example, see the PhotoPicker sample code project.
from this you can create your own customCameraView to show your own controls that you need to show

Custom Camera view for UIImagePickerController that uses the base camera UI?

I'm trying to build a slightly modified UIImagePickerController with a UIImagePickerControllerSourceTypeCamera source-type. I would like to retain the default controls of Flash, Front/Read facing camera, and Photo Capture but replace the default cancel button with a smaller cancel button & a button to launch the user's device photo-library. Is there a way to do this without having to recreate the entire camera UI? If there's not a way, is there a 3rd party library (commercial or open-source) that allows for this? Thanks.
I can tell you that there is no way to modify the standard camera UI unless you recreate it entirely, but I don't know if there is any library to help you with this. I had to create a new UI and I didn't find it difficult. You can easily bind the UI elements with the functionalities you need. This might get you started.

Resources