I want to set white barTintColor in some viewcontroller
I have set UINavigationBar.appearance().barTintColor
for all default color but when I use appearance whenContainedInInstancesOf
It's not change my viewcontroller
UINavigationBar.appearance(whenContainedInInstancesOf: [MyViewController.self]).barTintColor = .white
Any idea?. I tried this in my viewcontroller
self.navigationcontroller.navigationbar.barTintColor = .white
but I have to set color back to default when screen will disappear. I don't want to do like that. How can I do?
UINavigationBar.appearance(whenContainedInInstancesOf: [MyViewController.self]).barTintColor = .white
but it still not work! – Burleson