UILabel HTML rich text support

Normal UILabel Is used in the application interface displays a simple text tips,but,We can also use it to display the contents of a large segment of users that do not require the participation of editors - such as reading the tweet

These contents are characterized by a need to support rich text。 UILabel of attributedText This can be done,But how we support our most common HTML markup language?

Suppose we get an HTML document,It has put the content inside it read into memory,Swift became a save in the String ,Then,You can do:

then,HTML frames transferred by markdown,your UILabel It can easily md text support it!

Original article written by Gerber drop-off:R0uter's Blog » UILabel HTML rich text support

Reproduced Please keep the source and description link:https://www.logcg.com/archives/2700.html

By R0uter's Blog

The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。

Leave a comment

Your email address will not be published. Required fields are marked *