Created
April 11, 2018 16:16
-
-
Save ArchieR7/321dafbc406d1c0ddfe75d0f83bd9d4b to your computer and use it in GitHub Desktop.
convert to swift NSMutableAttributedString
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
var htmlString = NSMutableAttributedString() | |
do { | |
if let data = self.data(using: String.Encoding.unicode, allowLossyConversion: true) { | |
htmlString = try NSMutableAttributedString(data: data, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil) | |
} | |
} catch { | |
print(error) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment