I have MainViewController
in landscapeRight orientation which should present UIImagePickerController with sourceType = .camera:
imagePickerCamera.sourceType = UIImagePickerControllerSourceType.camera
imagePickerCamera.allowsEditing = false
self.present(imagePickerCamera, animated: true, completion: nil)
App crashes and then the error says (only on IPhone X):
'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [CAMViewfinderViewController shouldAutorotate] is returning YES'
I have set supported orientation in AppDelegate to .landscapeRight. I've tried to set all orientation in .plist and app delegate and only then show imagePicker, but it didn't resolve the issue.
I saw some solutions like this but it didn't help me too.
I found an workaround, but it's doesn't seems like a good solution. You need to set portrait orientation (or just supportedOrientation through supportedInterfaceOrientationsFor), then present picker and when you're done switch back to landscape if needed.
Also I saw somewhere an article in Apple documentation which says that UIImagePickerController supports only Portrait orientation, but I've been using landscape with the image/camera picker for a long time, so idk.