Creating attributed text from an HTML string

Paolo Montalto
1 min readApr 16, 2021

Every now and then you might have found yourself in the need to showing attributed text in your iOS app (e.g. in a UILabel) and considered how easy it is in HTML compared to an NSAttributedString.

Suppose you wanted to have a label with some underlined text, in HTML you would simply do the following:

Next word is <u>underlined</u>.

--

--

Paolo Montalto

Android Engineer, freelance, mobile developer, software craftsman, guitar strummer, husband, father, humble.