text Crear标签conenentes difenrentes(粗体,常规等)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text Crear标签conenentes difenrentes(粗体,常规等)相关的知识,希望对你有一定的参考价值。

extension NSMutableAttributedString {
    @discardableResult func semibold(_ text: String, size: Int) -> NSMutableAttributedString {
        let attrs: [NSAttributedStringKey: Any] = [.font: UIFont(name: "Barlow-Semibold", size: CGFloat(size))!]
        let semiboldString = NSMutableAttributedString(string:text, attributes: attrs)
        append(semiboldString)
        
        return self
    }
    
    @discardableResult func regular(_ text: String, size: Int) -> NSMutableAttributedString {
        let attrs: [NSAttributedStringKey: Any] = [.font: UIFont(name: "Barlow-Regular", size: CGFloat(size))!]
        let regular = NSMutableAttributedString(string:text, attributes: attrs)
        append(regular)
        
        return self
    }
}

以上是关于text Crear标签conenentes difenrentes(粗体,常规等)的主要内容,如果未能解决你的问题,请参考以下文章

text Generar crear小部件

text crear tabla temporal

text CREAR PROYECTO AGAVE

text postgres crear触发器

text crear link apex y abrir modal

text META crear un tag meta escalable响应