Created
September 16, 2015 01:52
-
-
Save dolphinSuPixnet/7cc7c8b8985529d0cba3 to your computer and use it in GitHub Desktop.
We can use this create HTML based attributed string. 我們可以這樣建立一個 HTML 樣式的 attributed string
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 attrStr = NSAttributedString( | |
data: "<b><i>text</i></b>".dataUsingEncoding(NSUnicodeStringEncoding, allowLossyConversion: true), | |
options: [ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], | |
documentAttributes: nil, | |
error: nil) | |
label.attributedText = attrStr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment