I\'m building an app with many view controllers: I have a UITabBarController
which holds 4 UINavigationController
. I want all the nav bars to be my cus
The way you are doing it is supposed to work, but it doesn't. This does work though:
UINavigationBar.appearance(whenContainedInInstancesOf: [YourOtherVC.self]).tintColor = .black
[[UINavigationBar appearanceWhenContainedIn:[YourOtherVC class], nil] setTintColor:[UIColor blackColor]];
For that you would do:
id specialNavBarAppearance = [UINavigationBar appearanceWhenContainedIn:[SpecialViewController class], nil];
[specialNavBarAppearance setBarStyle:UIBarStyleBlack];
[specialNavBarAppearance setTranslucent:YES];
Move your changes to viewWillAppear: instead of viewDidLoad: and it should work.