Xcode Version 11.0 beta 5 (11M382q)
I'm using the new appearance APIs to tint the color of the bar button items when one of my view controllers is the top view controller. I'm using the following code to do so:
let appearance = UINavigationBarAppearance()
let attributes: [NSAttributedString.Key : Any] = [.foregroundColor : tintColor]
appearance.largeTitleTextAttributes = attributes
appearance.buttonAppearance.normal.titleTextAttributes = attributes
appearance.doneButtonAppearance.normal.titleTextAttributes = attributes
navigationItem.standardAppearance = appearance
This seems to work fine for text-based bar button items, but the image based bar button items maintain the app's default tint. Is this a bug in iOS 13 beta? I've logged a radar, but just wanted to see if anyone else has encountered this or found a workaround.
As you can see below, the back arrow and the plus button are not the right color.
You have to set:
let backImage = appearance.backIndicatorImage.tint(with: tintColor)
appearance.setBackIndicatorImage(backImage, transitionMaskImage: backImage)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With