views:

458

answers:

1

Hi,

I am creating an app, in which the user will be able to choose a photo. Now I want that when the user taps a button, an UIActionSheet pops up to let the user choose if they want to use the Camera, or the Photo Library. The UIActionSheet should always be there, but the Camera option only if the device has a camera. I'm not sure if there is a standard method to do this, or if I need to implement it myself. Can anyone help me?

Thanks

+1  A: 

You will need to build this action sheet yourself and configure it based on the presence of a camera.

Finding out if a device has camera support is easy. Check the Device Support section for more information.

Quote from the guide:

Use the isSourceTypeAvailable: method of the UIImagePickerController class to determine if the camera is available. For more information, see “Taking Pictures with the Camera.”

willcodejavaforfood