I have a Root View Controller, from which I proceed to the next scene. This new view controller introduces the UIImagePickerController and selects the front camera when launched inside viewDidLoad:
cameraUI.cameraDevice=UIImagePickerControllerCameraDeviceFront;
This works, so the front camera is selected and displayed. I take a picture and move on to the next scene. Then I will leave and return to the Root View controller. I move on to the next scene again, which loads the UIImagePickerController again (when debugging, it reappears in viewDidLoad, so this works). Inside viewDidLoad, he again selects the front camera with the code above.
BUT! Now UIImagePickerController shows only the rear camera! If I go back to the root view controller a third time and load the UIImagePickerController again, it now shows the front camera as it should. For the fourth time, he shows the rear camera, etc.
I debugged it and every time it jumps to the code line from above, as expected, so I donβt understand why the rear camera is displayed every second time?
Jayar source share