I hope this is a simple fix. I developed a Swift/SwiftUI (XCode 13.2.1) iPhone app that works perfectly fine on iPhones when released on the Store. However, when an iPad user downloads the app from the Store, several of the app custom color assets are apparently not available, so none of the text shows up and some button colors are missing.
All the assets are included in "Copy Bundle Resources" in XCode's Build Phases. When I run the app in the iPad simulator, all the colors appear correct and the app functions normally. When I sideload onto both iPads in my house, the app functions completely normal. But when published to the store, assets are missing when downloaded to an iPad, but they work fine on iPhones.
I am perplexed. Thanks in advance for your thoughts.
Doug
Post
Replies
Boosts
Views
Activity
I am using Swift 5.3 and created a new "Multiplatform" app. I created custom color assets for light/dark modes but am having trouble getting the light mode background color to show on my TabView. The TabView dark mode background color appears just fine.
The light mode background color appears perfect in Xcode Preview, but when I run the app in the Sim or on my device, the Tab Bar background color is clear in light mode, but shows the correct color for dark mode.
I use the same color assets for coloring my NavigationView and both the light and dark mode colors appear correctly when the corresponding modes are selected.
Is there something obvious I am missing here with the latest SwiftUI 5.3 and color assets?
I am using the following code within .onAppear in the TabView
UITabBar.appearance().barTintColor = UIColor(named: "barBackground")
Note that "barBackground" is the custom color set I created to add a light/dark mode background colors to both the NavigationView and TabView.
Happy to furnish additional info if this isn't clear. Thanks!
Doug
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