Reputation: 5525
I already have this attribute on my code, but how to add attribute for underline?
NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:
boldFont, NSFontAttributeName, foregroundColor, NSForegroundColorAttributeName, nil];
Upvotes: 2
Views: 5551
Reputation: 9944
Just add a NSUnderlineStyleAttributeName
key with @(NSUnderlineStyleSingle)
as a value:
NSDictionary *attrs = @{ NSFontAttributeName : boldFont,
NSForegroundColorAttributeName : foregroundColor,
NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle) };
Upvotes: 13