UIImagePickerController.cameraFlashMode cannot be changed properly with showsCameraControls false in iOS 10

Originator:kedar.vaidya3
Number:rdar://28893812 Date Originated:10/21/2017
Status:Duplicate of 27560011 Resolved:
Product:iOS Product Version:10
Classification:AVFoundation (Audio / Video) Reproducible:Always
 
Area:
AVFoundation (Audio / Video)

Summary:
This only happens on iOS 10. Previous version of iOS work fine

UIImagePickerController.cameraFlashMode = .on or .auto or .off always sets the flash mode to off. This happens when showsCameraControls for the UIIMagePickerController instance is set to false. 

When showsCameraControls is true the cameraFlashMode is set as expected both with the default flash control as well as programmatically.

Steps to Reproduce:
1. Open the compressed project - ImaegPickerIssue.zip and run it in Xcode 8 on an iOS 10 device (minor version does not matter, this is reproducible on all release version of iOS10)
2. On the initial screen tap the button that says "Launch Camera" - a UIImagePickerController instance will be shown in camera mode. Allow the app to access the camera. The button in the upper left corner shows the current flash state. The state is shown correctly as Auto. The button can also be tapped to change the state.
3. Now tap the button to attempt to cycle through the various flash states.

Expected Results:
The cameraFlashMode should be set to the correct value as the program dictates when showsCameraControls is false. The button should successively show title as Auto->On->Off


Actual Results:
You will observe that the button always shows "Off". If you debug the functions flashButtonTapped and updateFlashTitle you will notice that the cameraFlashMode is always set to off overtime we attempt to change its state.


Version:
10.0.1 (14A403) or any other iOS10 version

Notes:
As mentioned, this bug is reproducible on any  iOS10 version. Hardware or minor version of iOS 10 does not matter. From the forums I see that this was a problem in iOS 10 beta too.

Configuration:
NA - this bug is iOS 10 specific and occurs on all iOS devices that are installed with any version of iOS10

Attachments:
'ImagePickerIssue.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!