How to render HTML string in UITextview with different font styles but same font family
问题 This is my HTML string: <i>Italics </i><b>Bold </b><u>Underline</u><blockquote>block quote<br></blockquote> I want all the styling to be same (Italic, bold etc), but I want to implement the font family as Open Sans. So, wherever its italics I want the font to be Open-Sans Italics. How do I implement that? Please help. 回答1: One way to achieve the desired behavior is this (copy-and-paste to a playground). import PlaygroundSupport import UIKit func attributedString(fromHTML html: String,