UIImagePickerController in iOS 13: Did apple abandon navigation bar customizability?

In iOS 13 some things seem to have changed in terms of customizing the navigation bar appearance. I want to customize the navigation bar of a

UIImagePickerController
. According to iOS 13 guidelines the code to change an existing navigation bar (in this case changing the
UIImagePickerController
navigation bar background color to red) would be:
let imagePickerViewController = UIImagePickerController()
let barAppearance = UINavigationBarAppearance()
barAppearance.configureWithDefaultBackground()
barAppearance.backgroundColor = .red
imagePickerViewController.navigationBar.standardAppearance = barAppearance
imagePickerViewController.navigationBar.scrollEdgeAppearance = barAppearance

Unfortunately, this does not work. In general setting

imagePickerViewController.navigationBar
appearance does not have any influence on the presented
UIImagePickerController
.


The only thing that seems to be working is changing the default appearance of all

UINavigationBars
like this:
UINavigationBar.appearance().tintColor = .red

But this does not allow individual customization and does not allow for extending the navigation bar with your own

UIBarButtonItems
and other navigation bar elements.


I have seen discussion about this topic, but none of those discussions has a working answer and none of them discusses if apple has made any changes in terms of general customizability of the

UIImagePickerController
. So here are my questions:
  • Did apple remove the option of customizing the navigation bar of an
    UIImagePickerController
    in iOS 13?
  • If not, how do you actually customize the navigation bar of an
    UIImagePickerController
    in iOS 13?

Replies

AFAIK what has changed is the need to use the appearance, as you noticed.


You cannot subclass UIImagePickerController either:

Important: The UIImagePickerController class supports portrait mode only. This class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified, with one exception. You can assign a custom view to the cameraOverlayView property and use that view to present additional information or manage the interactions between the camera interface and your code.

You probably saww this as well:

https://stackoverflow.com/questions/21062327/subclassing-uiimagepickercontroller-for-adding-functionality

Unfortunately setting navigation bar appearance on the UIImagePickerController (as described in my initial post) has no effect at all. I am aware of the cameraOverlayView, which I am already using. What I want to do is modify the navigation bar of the UIImagePickerController. So far I have seen no working solutions.