In Mojave, any overriding of drawing methods makes it impossible to change the backgroundColor of the NS button when highlighted. Therefore, I would recommend using
- (BOOL)_shouldDrawTextWithDisabledAppearance
for this. If you are using Swift 4, I would do the following in the Bridging header:
And in a subclass of NSButtonCell:
override func _shouldDrawTextWithDisabledAppearance() -> Bool { return false }
Ricardo anjos
source share