Skip to content

Instantly share code, notes, and snippets.

@podkovyrin
Created September 11, 2014 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save podkovyrin/c8e68a6366070261caff to your computer and use it in GitHub Desktop.
Save podkovyrin/c8e68a6366070261caff to your computer and use it in GitHub Desktop.
NSAttributedString from html string
[[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUTF8StringEncoding]
options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType,
NSCharacterEncodingDocumentAttribute: @(NSUTF8StringEncoding)}
documentAttributes:nil error:nil];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment