on OSX I have an NSButton with a pretty dark image and unfortunately it is not possible to change the color using the attributes inspector. See picture the big black button,
Swift 5
You can use this extension:
extension NSButton {
@IBInspectable var titleColor: NSColor? {
get {
return NSColor.white
}
set {
let pstyle = NSMutableParagraphStyle()
pstyle.alignment = .center
self.attributedTitle = NSAttributedString(
string: self.title,
attributes: [ NSAttributedString.Key.foregroundColor :newValue, NSAttributedString.Key.paragraphStyle: pstyle])
}
}
}
Now you can set title color in storyboard easily. Cheers!