多种颜色的文字iOS

我们将实现MutableString来帮助为小部件提供多种颜色的文本

这就是我们所需要的:

 让minAttr = NSMutableAttributedString(string:{text})minAttr.addAttribute(NSAttributedStringKey.foregroundColor,value:{color} range:NSMakeRange(0,minAttr.length))attributedText.append(minAttr) 

提供可同时处理多种文本颜色的扩展

Interesting Posts