Search code examples
iosobjective-cnsattributedstring

Change substrings of NSString to bold


I have an NSString, that contains tags [strong][\strong]. Inside this tags, this words must be bold to be shown in a UITextView and then delete all the container tags once words are formatted,and I can't use an UIWebView. I think I must use attributedStrings, but I'm not sure how can I achieve it.


Solution

  • Instead of using UITextView you can use advanced UILabel like OHAttributedLabel or CoreTextAttributedLabel. Download the sample, its good & clean. You can change colors, fonts, sizes, underline, and almost everything for parts of a string.