I have a sample project that sets the bar tint color when the app launches:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
UINavigationBar.appearance().barTintColor = UIColor.red
return true
}
It has 1 view controller (inside of a UINavigationController), with this code in it:
@IBAction func launchDocument(_ sender: Any) {
if let url = Bundle.main.url(forResource: "example", withExtension: "pdf") {
let controller = UIDocumentInteractionController(url: url)
controller.delegate = self
controller.presentPreview(animated: false)
}
}
func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController {
return self
}
In iOS 10, both the main view controller and the UIDocumentInteractionController have red navigation bars. In iOS 11, the UIDocumentInteractionController isn't red. Is this a bug with iOS 11? Or is there another way to do this?
P.S. - I know that I can return self.navigationController in the delegate, but I need the UIDocumentInteractionController to have a "Done" button, not a "Back" button