0

I know how to check if a string (NSString) contains another smaller stringFor this m doing like:

if ([string rangeOfString:@"bla"].location == NSNotFound) {
  NSLog(@"string does not contain bla");
} else {
  NSLog(@"string contains bla!");
// here I need to make that string bold
}

Apart from this I want if I got that string I want to make it bold in the original string.So, is there any way to make my particular String Bold? Thanks in advance...

iCoder4777
  • 1,682
  • 1
  • 14
  • 35

1 Answers1

1

You will have to use NSAttributedString. But problem is displaying NSAttributedString.

In iOS 6.0's label support NSAttributedString but less version will need third party label.

Use TTTAttributedLabel link for NSAttributedString.

Refer ios-using-tttattributedlabel-to-set-two-color-text link for reference.

Community
  • 1
  • 1
Paresh Navadiya
  • 38,095
  • 11
  • 81
  • 132