ios UILabel显示html文本

                let attrContent = try NSAttributedString(data: htmlContent, options: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], documentAttributes: nil)
                cell?.contentLabel.attributedText = attrContent
                cell?.contentLabel.numberOfLines = 0
                cell?.contentLabel.preferredMaxLayoutWidth = CGRectGetWidth(tableView.bounds)

你可能感兴趣的:(ios)