@xworld do {
let attrStr = try NSAttributedString(data: html.data(using: String.Encoding.unicode, allowLossyConversion: true)!, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil)
label.attributedText = attrStr
} catch {
print("解析html出錯(cuò) : \(error)")
label.text = ""
}
Swift3.0下,UILabel加載html,實(shí)現(xiàn)富文本上述方法是寫在UITableViewCell中給cell上的UILabel賦值; 以上是下發(fā)的html標(biāo)簽