I tried the above solutions and even using UIBarItem's setTitleAttributes for state, but none of them worked consistently for me.
As a last effort, I set the tintColor on the UIBarButtonItem:
let isEnabled = <computed property>
myBarButtonItem.isEnabled = isEnabled
myBarButtonItem.tintColor = isEnabled ? UIColor.systemBlue : UIColor.systemGray
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: