How do I make this iOS navigation bar color change work in the context of a UIPageViewController?

Viewed 14

This code works to set the color of my navigation bar in my initial viewController. However, it does not update when I segue to my next VC, which is embedded in a UIPageViewController. I have tried the code in the viewDidLoad for both the UIPageViewController itself and the first VC that it loads, but neither updates the actual nav bar color (although the print function runs successfully).

        if #available(iOS 15, *) {

            let appearance = UINavigationBarAppearance()
            print("wlVWA")
            appearance.configureWithOpaqueBackground()
            appearance.backgroundColor = Colors.colorTitleScheme[1].0
            UINavigationBar.appearance().standardAppearance = appearance
            UINavigationBar.appearance().scrollEdgeAppearance = appearance
            
        } 
0 Answers
Related