I am getting a HTML Response from a webservice Below is the HTML I am getting in response
TopicGud mrng.
\\n
Here is the swift 2 version:
let htmlStringData = NSString(string: "Your HTML String here").dataUsingEncoding(NSUTF8StringEncoding)
guard let html = htmlStringData else { return }
do {
let htmlAttrString = try NSAttributedString(data: html, options: [ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], documentAttributes: nil)
yourLabel.attributedText = htmlAttrString
} catch {
print("An error occured")
}