I would like to know how to switch on the camera flash on the iPhone 4 with UIImagePickerController.
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerCameraDeviceFront] == YES)
{
/// What code here ///
}
else
{
NoFlash = [[UIAlertView alloc] initWithTitle:@"Uh-Oh"
message:@"Your device doesn't have a flash camera"
delegate:nil
cancelButtonTitle:@"mhmm, OK"
otherButtonTitles:nil];
NoFlash.delegate = self;
[NoFlash show];
[NoFlash release];
}
}
I already read the UIImagePickerController Class Reference web page here: http://bit.ly/cdAhhB but I didn't find the answer. Can someone please help me?
Thanks
You can use this. Basically call 'toggleTorch' when you want to turn the flash on or off. Hopefully this is what you were looking for.
alternately..