Last active
August 29, 2015 14:25
-
-
Save externvoid/c8c97934bf037641efc9 to your computer and use it in GitHub Desktop.
サニタイズされてしまったHTMLを、元に戻す。<とかを元に戻す。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 本文ラベルを取得して、本文を設定する | |
let descriptionLabel = cell!.viewWithTag(2) as! UILabel | |
let htmlString = entry["contentSnippet"] as? String | |
do { | |
let astr = | |
try NSAttributedString(data: | |
htmlString!.dataUsingEncoding(NSUnicodeStringEncoding)!, | |
options: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], | |
documentAttributes: nil) | |
descriptionLabel.text = astr.string | |
} catch { } | |
// descriptionLabel.text = entry["contentSnippet"] as? String |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment