Set tintColor for UINavigationBar only for specific child view controller

ios, tintcolor, uinavigationbar, uinavigationcontroller

Solution

In iOS 8 we set tint color by this :-

self.navigationController.navigationBar.barTintColor = [UIColor redColor];

Problem

I have a basic master-detail app. Depending on the item that is selected in the master list, I'd like to set the `tintColor` of the navigation bar in the details view only. I set the tint color like so: `self.navigationController.navigationBar.tintColor = detailTintColor;` in `viewWillAppear:` of the details controller. However, this also changes the color of the master controller's navigation bar to yellow (should remain red), which is visible as a flickering during the transition animation. I assume because there is only one navigation bar instance. Here a screenshot to illustrate the problem: - The "i" icon is in the master view controller's navbar and should be red, not yellow

Original source

Related problems