NSMutableAttributedString

public extension NSMutableAttributedString
  • Set color for specific text in attributed string

    Declaration

    Swift

    @objc
    func setColor(for text: String, with color: UIColor)

    Parameters

    text

    Text to change color

    color

    Changing color

  • Set font for specific text in attributed string

    Declaration

    Swift

    @objc
    func setFont(for text: String, with font: UIFont, kern: Double = 0)

    Parameters

    text

    Text to change font

    font

    Changing font

    kern

    Changing kern

  • Set attributes for specific text in attributed string

    Declaration

    Swift

    @objc
    func setAttributes(for text: String, attributes: [NSAttributedString.Key : Any])

    Parameters

    text

    Text to change attributes

    attributes

    Changing attributes