Html string set into UILabel

16,160

Solution 1

To convert HTML to plain text Download File

and use

stringByConvertingHTMLToPlainText function on your string.

Solution 2

You can use DTCoreText (previously known as NSAttributedString Additions for HTML).

Share:
16,160
Hiren
Author by

Hiren

Updated on June 11, 2022

Comments

  • Hiren
    Hiren almost 2 years

    I am getting NSString with contain some html tag.
    Now I want to set this string into UILabel with working of this html tag

  • sudip
    sudip over 11 years
    DTCoreText is a great component. I used it in a project. I had to show more than 10 controls and each of the controls contain html text. So, UIWebview is not a good choice. I used DTCoreText and it is very lightweight.
  • Deepak G M
    Deepak G M about 11 years
    But that is just going to destroy the HTML formatting. The whole point of wanting to use HTML would be to have some basic styles (not using CSS) which is something more than plain text.