UIImagePickerController both camera and library - iphone

I would have though that the UIImagePickerController would allow you to use the camera or choose from the library from within the view? It seems I have to pick one or the other cia the sourceType? Is there no way to add a button to the choose library view to switch to camera?

You would have to implement this yourself. You can make a simple UISegmentedControl and when the value is changed, you change the source of the UIImagePickerController.

Related

iPhone camera toolbar buttons

The iPhone camera toolbar holds the following buttons: cancel/record
I would like to change the cancel button to the small image button that takes me to the photo library.
I wasn't sure if i need to use the overlay or does the xcode have something more comfortable in this case since this is something well known and used.
Is there something like this?
Thanks,
You can set overlayView to your UIImagePickerController
imagePicker.cameraOverlayView = yourOverlayView;
UIImagePickerController Class Reference
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.

UIImagePickerController pushed on my own UINavigationalController?

I'm trying to take the UIImagePickerController set to UIImagePickerControllerSourceTypeCamera (ie when it allows the user to take a picture) and push it on my own UINavigationalController but it doesn't work (can't push a UINavigationalController onto another UINavigationalController).
I'm wondering, is there anyway to make a custom version of this camera module, much like you can do with the UIImagePickerControllerSourceTypePhotoLibrary UIImagePickerController using ALAssets? I'd just like to not have to pop up the camera as a modal view and would like to push it on my own UINavigationalController.
You can custom camera using AVFoundation.
Refer Sample AVCam for how to use AVFoundation for it.
Your main issue is that the UIImagePickerController is itself a UINavigationController, so pushing that onto a navigation controller is going to have problems (as you've already found)
As Prince has mentioned, your best bet is to use the AVFoundation to create your own. The downside is you'll (by default) lose the nice features of the camera app such as touch to focus, pinch to zoom etc. but these can all be added yourself.
Check out this tutorial which gives you a nice explanation on how to use the AVFoundation library for this, and also shows you how to add things like an overlay to the camera screen. Then you can easily find on google/stackoverflow how to add things like tap to focus :)

allow UIImagePickerViewController to add from library and camera

Is there an interface for allowing user tap once and be able to pick an image from the library OR the camera at the same time? I know there is way to have two buttons. I want to limit it to one button and not use an actionsheet and allow the user to switch between library and the camera while they are in the imagepicker UI. So, is there a way to set this both value? Thanks.
UIImagePickerControllerSourceTypeCamera
UIImagePickerControllerSourceTypePhotoLibrary

UIActionSheet... How to implement UIImagePicker?

I'm new to iOS developement... I want to add 3 buttons on this view: cancel, choose from library and take from camera.
I already know the UIImagePicker method.
Thanks
Ciao Davide, reading UIImagePickerController Class Reference should be useful:
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.
Here there is UIImagePickerController Class Reference:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html
And here there is PhotoPicker sample code:
http://developer.apple.com/library/ios/#samplecode/PhotoPicker/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010196

UiimagePIckerController Interface with both camera and video

How can we display the UiImagepicker controller interface with both camera and video mode, as it is in the default camera application on iPhone.
UIImagePickerController has a mediaTypes property, which is an array of types you want to support (image, video, or both):
http://developer.apple.com/library/ios/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple_ref/occ/instp/UIImagePickerController/mediaTypes
The way it has it within the OS is that it changes the picker via a slider in the bottom toolbar.
When the value changes from photo to video via the slider, you could recreate the UIImagePickerController with the appropriate mediaType and reload the view.
I do not know if this would be as seemless as the iPhone included way of doing things without testing it, however, this would allow you to change the picker being used from one to the other.