0
votes

I'm currently using this in the viewDidLoad method of one of my VC's, that is embedded in a navigation controller .. we'll refer to the embedded VC as VC1.

self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:153/256.0 green:204/256.0 blue:53/256.0 alpha:1.0];

-(can't ctl+k, on iPhone).. Anyway, the code is effectively changing my VC's UIBarButtonItem's colors, however, it is also changing the bar buttons of my second view controller, which is pushed from VC1 (NavController embedded VC1 push segues to "VC2"), how do I keep the tintColor of VC2 from changing?

P.S. I need to keep the push segue.

1

1 Answers

1
votes

According to Apple's documentation for tintColor:

Discussion

In iOS v7.0, all subclasses of UIView derive their behavior for tintColor from the base class. See the discussion of tintColor at the UIView level for more information.

Which means that all views now pick up the tintColor from the navigation bar. If you want to set it special for only one view controller, you'll need to set a default color for all your views and then set it explicitly during "viewWillAppear:" (and possibly undo it -- or restore the original tint color that you want -- via "viewWillDisappear").