I\'m creating iOS app that has a label. I want to set two colors. One for first part and other color for remaining part.
I\'ve seen some messages in Stack over flow that, TT
You could use TTTRegexAttributedLabel available at : https://github.com/kwent/TTTRegexAttributedLabel. (TTTAttributedLabel based but more easier to use with regular expressions)
//SET FONT ONLY ON FIRST MATCH REGEX
TTTRegexAttributedLabel *label = [[TTTRegexAttributedLabel alloc] init];
label.textColor = [UIColor whiteColor];
NSString *s = @"ABC > def";
[self.label setText:s withFirstMatchRegex:@"^[a-zA-Z ]*>"
withFont:[UIFont systemFontOfSize:12]
withColor:[UIColor brownColor]];