Ser Pounce
Ser Pounce

Reputation: 14557

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.

Upvotes: 0

Views: 243

Answers (2)

PaReeOhNos
PaReeOhNos

Reputation: 4428

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 :)

Upvotes: 1

Paresh Navadiya
Paresh Navadiya

Reputation: 38249

You can custom camera using AVFoundation.

Refer Sample AVCam for how to use AVFoundation for it.

Upvotes: 1

Related Questions