Appending Attributed Strings and bold text in Swift
suggest changelet someValue : String = "Something the user entered"
let text = NSMutableAttributedString(string: "The value is: ")
text.appendAttributedString(NSAttributedString(string: someValue, attributes: [NSFontAttributeName:UIFont.boldSystemFontOfSize(UIFont.systemFontSize())]))
The result looks like:
The value is: Something the user entered
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents