Skip to content

Instantly share code, notes, and snippets.

@mattb
Created March 19, 2014 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattb/9652526 to your computer and use it in GitHub Desktop.
Save mattb/9652526 to your computer and use it in GitHub Desktop.
NSString *description = @"ABCDEFGHIJ";
NSMutableAttributedString *aDescription = [[NSMutableAttributedString alloc] initWithString:description];
[aDescription addAttributes:@{NSForegroundColorAttributeName: [UIColor redColor],
NSBackgroundColorAttributeName: [UIColor lightGrayColor],
NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle)}
range:NSRangeFromString(@"{2,5}")
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment