iOS 13 - Set title of UIImagePickerController?

I have an app where a user chooses a video from their library using UIImagePickerController. When I present the the UIImagePickerController, I set a custom title for it ("Choose Video"). I have done this in the past (pre-iOS 13) by setting my class as a UINavigationControllerDelegate, and calling one of the delegate functions like this:


func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {

viewController.navigationItem.title = "Choose Video"

}


However, this seems to be broken when I run the app on iOS 13. No matter how I try to set the title, the nav bar of the picker will always be set to the default title ("Photos").


When I build the app on Xcode 11 with an iOS 12 simulator the title is set correctly.


Is there a change in behavior for this on iOS 13? Or is this a bug?


I am using the Xcode 11 GM Seed.

Replies

Did you check that the delegate function is called ?

Yes, it is called. I set a breakpoint, it is hit right before the ImagePicker is presented.

We have time same issue in our app with iOS 13. The delegate method is called, but the title still reads "Photos".

So, viewController is a view party of the navigation of navigationController.


Could you try this:


func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {

         let controller = navigationController.topViewController
         controller.navigationItem.title = "Choose Video"
}

See my answer to matt-lifejourney

It didn't work.

Did you find a solution for this?