I created an app with a TabBar and utilized AppDelegate to control it's background color using the code below. I have a custom ColorSet in Assets ("headerFooter") that sets the Light and Dark mode colors for my TabBar. The app will not change the TabBar back to the correct Light Mode color when I change from Dark to Light in the simulator or on my iPhone X.
I am using Catalina v10.15 beta (19A578c) and Xcode 11.2 beta. My iPhone is running iOS 13.1.2.
With the phone in Dark Mode, I open the app and it opens with the correct colors. Conversely, when I start the app with the phone in Light Mode, the app opens with the correct colors. When I change from Light Mode to Dark Mode, the colors change accordingly. However whenever I change from Dark Mode to Light Mode, the TabBar remains showing the Dark Mode color.
UITabBar.appearance().barTintColor = UIColor(name: "headerFooter")
Any ideas?
Thanks,
Doug
Where in the AppDelegate are you using this code?
Also, if this is a SwiftUI app, you'll have better luck setting the colors on "TabView" itself using a modifer.
SwiftUI will automatically re-render your views when you switch to and from dark mode.
I imagine the issue here is the AppDelegate method that you're using isn't being called again after you change to (and from) dark mode.