How do I change my TabBar's color/tint in SwiftUI? I can set it once on init using the following:
init() {
UITabBar.appearance().barTintColor = .green
}
var body: some View {
TabView {
...
but later, when a button is pressed, I want to change the color to something different. Simply updating the appearance() of UITabBar like above has no effect. I'm thinking I need to somehow "commit" my changes or mark the TabBar as needing to be updated, but I'm not sure how this would be done. Thanks