Skip to content

Instantly share code, notes, and snippets.

@anil826
Created May 24, 2016 09:33
Show Gist options
  • Save anil826/f1724e205f23e2f141dfd16b62e575c6 to your computer and use it in GitHub Desktop.
Save anil826/f1724e205f23e2f141dfd16b62e575c6 to your computer and use it in GitHub Desktop.
//AtrributedString for different color.
NSString *str = [NSString stringWithFormat:@"You Have Selected %@", treeModel.name];
NSMutableAttributedString *message = [[NSMutableAttributedString alloc] initWithString:str];
[message addAttribute: NSForegroundColorAttributeName value:[UIColor blackColor] range:[str rangeOfString:[NSString stringWithFormat:@"%@",treeModel.name]]];
cell1.descriptionLabel.attributedText = message;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment