I found a reproducible issue in iOS 18+. When a SwiftUI TabView contains a Map (MKMapView), any custom UITabBarAppearance badge color is ignored while that tab is active. As soon as you switch to a tab without a Map, the custom badge color is applied again.
Minimal example:
struct ContentView: View {
var body: some View {
TabView {
Tab {
Map()
} label: {
Label("Map", systemImage: "map")
}
Tab {
Text("Second")
} label: {
Label("Profile", systemImage: "person")
}
.badge(2)
}
.onAppear {
let appearance = UITabBarAppearance()
appearance.stackedLayoutAppearance.normal.badgeBackgroundColor = .black
UITabBar.appearance().standardAppearance = appearance
UITabBar.appearance().scrollEdgeAppearance = appearance
}
}
}
Looks like MapKit forces its own tab bar appearance. Anyone found a workaround?

