I would like to know how to switch on the camera flash on the iPhone 4 with UIImagePickerController.
if ([UIImagePickerController isSourceTypeAvailable:UIImagePi
-(void)flashSelected
{
if (PickerController.cameraFlashMode ==
UIImagePickerControllerCameraFlashModeOff) {
if ([UIImagePickerController
isFlashAvailableForCameraDevice:UIImagePickerControllerCameraDeviceRear ])
{
PickerController.cameraFlashMode =
UIImagePickerControllerCameraFlashModeOn;
}
}
else
{
PickerController.cameraFlashMode =
UIImagePickerControllerCameraFlashModeOff;
}
}
alternately..
-(void)_flashToggle
{
if (! [UIImagePickerController isFlashAvailableForCameraDevice:UIImagePickerControllerCameraDeviceRear ])
return;
if (PickerController.cameraFlashMode == UIImagePickerControllerCameraFlashModeOff)
PickerController.cameraFlashMode = UIImagePickerControllerCameraFlashModeOn;
else
PickerController.cameraFlashMode = UIImagePickerControllerCameraFlashModeOff;
}