PHPickerViewController's navigation bar

Hi all, I'm developing an app that uses a coordinator pattern. I have a router that presents modally view controllers passed to it. It basically adds the passed view controller to the navigation controller and attaches a cancel navigation bar button.

This way I have the flexibility to present any view controller either modally or push it.

The problem is PHPickerViewController. It has its own "add" and "cancel" buttons which I don't how to disable. It seems that they are not in view controller's navigation bar. And doing something like this:

navigationController.setViewControllers([phPickerViewController], animated: false)

just adds another navigation bar on top. That looks ugly.

How can I overwrite the default PHPickerViewController's "navigation bar"?

// I can make a customer PHPickerViewController or, easier, a custom router for it, but that seems like a lot of custom work for such a simple thing. I'd rather make a proper configuration in coordinator...

Many SDK provided view controllers provide their UI from a remote process, and PHPickerViewController looks to be no different. As such you cannot modify nor remove any UI it presents and does not itself provide API for (while I'm unfamiliar with PHPickerViewController, I would expect all the API it provides to be relatively obvious in this case).

So I would recommend you always present it modally so it can provide its UI rather than trying to suppress parts of that UI.

PHPickerViewController's navigation bar
 
 
Q