NSMutableAttributedString
public extension NSMutableAttributedString
-
Set color for specific text in attributed string
Declaration
Swift
@objc func setColor(for text: String, with color: UIColor)Parameters
textText to change color
colorChanging color
-
Set font for specific text in attributed string
Declaration
Swift
@objc func setFont(for text: String, with font: UIFont, kern: Double = 0)Parameters
textText to change font
fontChanging font
kernChanging kern
-
Set attributes for specific text in attributed string
Declaration
Swift
@objc func setAttributes(for text: String, attributes: [NSAttributedString.Key : Any])Parameters
textText to change attributes
attributesChanging attributes
View on GitHub
NSMutableAttributedString Extension Reference