Converting a NSAttributedString into a NSString using Swift
if you want to keep the atributted string simply use yourLabel.attributedText = atributedTtext
If you strictly want an NSString
, not a String
use the following:
let s = attributedString.string as NSString
Use the string
property on NSMutableAttributedString
:
var attributedString = NSMutableAttributedString(string: "hello, world!")
var s = attributedString.string