I am getting a HTML Response from a webservice Below is the HTML I am getting in response
TopicGud mrng.
\\n
The above answer in Swift 3:
var str = " ... some html ... "
let htmlStringData = NSString(string: str).data(using: String.Encoding.utf8.rawValue)
let html = htmlStringData
do {
let htmlAttrString = try? NSAttributedString(
data: html!,
options: [ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType],
documentAttributes: nil
)
agreementText.attributedText = htmlAttrString
} catch {
print("An error occured")
}