Here's what I have tried so far:
func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController
{
navigationController?.navigationBar.barTintColor = UIColor.black
navigationController?.navigationBar.backgroundColor = UIColor.black
navigationController?.navigationBar.tintColor = UIColor.white
navigationController?.navigationBar.isTranslucent = false
return self.navigationController ?? self
}
I have tried it using UINavigationBar.appearance().barTintColor = UIColor.black
, still it didn't work.
At best the navBar changes to translucent color of the previous ViewController.
Blockquote