Created
February 1, 2018 07:44
-
-
Save Anatoli-Petrosyants/535284bf60e7adec6059392c3224b60d to your computer and use it in GitHub Desktop.
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
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