I have a custom button that subclasses NSButton. I want to change the content tint color when the button is in pressed state. This is what I have:
open override func mouseDown(with event: NSEvent) {
// update contentTintColor
contentTintColor = contentTintColorPressed
// call super to inherit the click action
super.mouseDown(with: event)
// for some reason mouseUp doesn't trigger if I call super, so I have to override and manually call mouseUp
self.mouseUp(with: event)
}
The result of this is the content tint color becomes the backgroundColor, so the button content is invisible. Why is that the contentTintColor updates only when I drag my cursor outside of the button? demo