Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Anatoli-Petrosyants/535284bf60e7adec6059392c3224b60d to your computer and use it in GitHub Desktop.
Save Anatoli-Petrosyants/535284bf60e7adec6059392c3224b60d to your computer and use it in GitHub Desktop.
extension NSMutableAttributedString {
@discardableResult func bold(_ text: String) -> NSMutableAttributedString {
let attrs: [NSAttributedStringKey: Any] = [.font: UIFont(name: "NotoSans-Bold", size: 14)!]
let boldString = NSMutableAttributedString(string:text, attributes: attrs)
append(boldString)
return self
}
@discardableResult func normal(_ text: String) -> NSMutableAttributedString {
let normal = NSAttributedString(string: text)
append(normal)
return self
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment