Skip to content

Instantly share code, notes, and snippets.

View Jusung's full-sized avatar

jusung Kye Jusung

View GitHub Profile
Jusung / NSMenuItemAttributedTitle.m
Created March 12, 2017 16:53
An example of NSMenuItem which has NSAttributed Title.
NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:@"Avenir Next" action:nil keyEquivalent:@""];
NSDictionary *attributes = @{ NSFontAttributeName: [NSFont fontWithName:@"Avenir Next" size:13.0] };
NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:[menuItem title] attributes:attributes];
[menuItem setAttributedTitle:attributedTitle];