Hello, I'm a bit new to iOS development, so this could be something I've overlooked, but I've tried a bunch of things on my own and with the help of Copilot, as well as some senior engineers here at my company. I let AI summarize what the problem is, what I've tried, what doesn't work, and also some information on the system:
Problem: UITabBarAppearance Custom Colors Ignored - All Diagnostics Show Correct Configuration
Environment:
- iOS Deployment Target: 13.4
- Xcode: Latest (26.4.1 as of writing)
- Device/Simulator: Both affected
- Language: Swift
- UI: UIKit with Storyboards
Description: Tab bar selected item displays system default colors (gray in light mode, white in dark mode) instead of my custom named color from asset catalog. System colors like .systemBlue work correctly, but custom asset catalog colors are completely ignored.
Expected behavior: Selected tab bar item should display BlueTVColor2 (RGB 0, 0.173, 0.38 in light mode; RGB 0, 0.569, 1.0 in dark mode)
Actual behaviour: Selected tab bar item displays gray/white/black system defaults
What I've Verified Works Correctly:
- Color resolution:
let color = UIColor(named: "BlueTVColor2")
print(color) // Resolves correctly
print(color?.resolvedColor(with: .init(userInterfaceStyle: .light)))
// RGB(0, 0.173, 0.38)
print(color?.resolvedColor(with: .init(userInterfaceStyle: .dark)))
// RGB(0, 0.569, 1.0)
- Asset Catalog Configuration:
- BlueTVColor2.colorset has both light and dark variants
- template-rendering-intent: template set on all tab bar images
- All images use .alwaysTemplate rendering mode (verified at runtime)
- UITabBarAppearance Configuration (Although I've also tried just directly in the storyboard, it didn't work, the below is in code-behind):
override func viewDidLoad() {
super.viewDidLoad()
let selectedColor = UIColor(named: "BlueTVColor2")!.resolvedColor(with: traitCollection)
let normalColor = UIColor.redTVColor.resolvedColor(with: traitCollection)
let appearance = UITabBarAppearance()
appearance.configureWithOpaqueBackground()
let itemAppearance = UITabBarItemAppearance()
itemAppearance.selected.iconColor = selectedColor
itemAppearance.selected.titleTextAttributes = [.foregroundColor: selectedColor]
itemAppearance.normal.iconColor = normalColor
appearance.stackedLayoutAppearance = itemAppearance
appearance.inlineLayoutAppearance = itemAppearance
appearance.compactInlineLayoutAppearance = itemAppearance
tabBar.isTranslucent = false
tabBar.standardAppearance = appearance
if #available(iOS 15.0, *) {
tabBar.scrollEdgeAppearance = appearance
}
tabBar.tintColor = selectedColor
tabBar.unselectedItemTintColor = normalColor
}
Runtime Diagnostics Confirm Everything is Set Correctly:
Appearance selected iconColor: RGB(0, 0.569, 1) // Correct
Tab bar standardAppearance selected iconColor: RGB(0, 0.569, 1) // Correct
Tab bar tintColor: RGB(0, 0.569, 1) // Correct
Tab bar unselectedItemTintColor: RGB(1, 0.259, 0.271) // Correct
All tab bar item images: Rendering mode = 2 (.alwaysTemplate) // Correct
Settings persist through viewDidAppear // Correct
Yet the UI displays system default gray/white/black colors.
What I've Tried (All Failed):
- Deprecated selectedImageTintColor property (returns nil when standardAppearance is set)
- Both configureWithDefaultBackground() and configureWithOpaqueBackground()
- Dynamic colors vs resolved fixed colors
- Configuring all layout appearances (stacked, inline, compactInline)
- Setting isTranslucent = false
- Re-applying appearance in viewDidAppear with delayed dispatch
- Manually re-applying template rendering mode to images at runtime
- Removing storyboard color configuration entirely
- Changing global accent color build setting
- System colors (.systemBlue) work fine; only custom asset catalog colors fail
Additional Context:
- This is a legacy project originally created around 2013-2015, migrated to modern Swift/iOS (not everywhere, major parts are still using objc, UIKit/Storyboard)
- When I set tabBar.tintColor = .systemBlue it works perfectly
- The color BlueTVColor2 is used successfully elsewhere in the app (also if setting it as the background of the UITabBar, it works, just not as a tint for the icons/text)
- Storyboard has no selectedImageTintColor set (removed during debugging)
- No UITabBar.appearance() proxy calls anywhere in codebase
- Deployment target is iOS 13.4 (when UITabBarAppearance was introduced)
- Pre iOS 26.0, the adding of the tint color to the UITabBar worked as intended, so this has come as a result of the update to iOS 26.0 in some way
Comparison with Working Test Project:
Created a fresh iOS project with same setup - custom asset catalog colors work perfectly in tab bar with identical UITabBarAppearance configuration.
Question:
Why would UITabBarAppearance properties show correct colors in diagnostics but render with system defaults? Is there a known issue with asset catalog named colors in UITabBarAppearance on iOS 13.4+? Could legacy project settings interfere with modern appearance API?
Any insights would be greatly appreciated. I'm running out of ideas and this seems like either a framework bug or some undocumented interaction between asset catalogs and tab bar appearance.
Code Sample:
I can't release much code besides just things I've worked on, so hopefully this full description of the problem and everything I've tried can help illuminate the issue at hand. I've tried all of the above and probably more the past week and can't make heads or tails of where the issue is located. The best I can come up with right now is some sort of compatibility issues but I have no way of determining where it is that I should investigate and fix.