S.Shahsiah S.Shahsiah - 8 months ago 87
Swift Question

How can I set a custom color and font size for the title of an NSButton?(in OS X NOT iOS)

For example consider I have a button named Button and its title is "Hello" . How can I make the title red colored with a font size of 35?
Thanks for all your answers in advance!



    button.attributedTitle = NSAttributedString(string: "Title", attributes: [ NSForegroundColorAttributeName : NSColor.redColor(),  NSFontAttributeName: UIFont(name: "Chalkduster", size: 35.0)!])