I am writing an app with multiple targets and want to change the default tint color for each target individually. I have a file containing constants for each target, including the definition for the tint color, kTintColor
.
This is what I tried to do:
self.window?.tintColor = kTintColor
UIView.appearance().tintColor = kTintColor
The tint color changes as i want to, but it causes another problem:
In some of my views, I need to change the tint of a single UIBarButtonItem
while the others keep the global tint.
This is achieved by calling self.barBtnX.tintColor = ...
If I user the global tint color set in my storyboard file, this works as expected. However, after changing the tint color in my AppDelegate it stops working.
Is there another way to do this?
EDIT:
I am able to change the global tint color for each target, but after I do so, I can no longer change the tint color of a single UIBarButtonItem
. I want to know if there is a way to achieve both.