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).
Author by
Hiren
Updated on June 11, 2022Comments
-
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 over 11 yearsDTCoreText 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 about 11 yearsBut 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.