NSAttributedString 工具包装库
let hello: NSAttributedString = "Hello".attributes.with(attributes: .foreground(.red) + .background(.yellow))
let hello2: NSAttributedString = "Hello".attributes.foreground(.red).background(.yellow)
let hello3: NSAttributedString = "Hello".attributes.foreground(.red).background(.black)
let hello4: NSAttributedString = "Hello".attributes.font(.systemFont(ofSize: 18, weight: .medium))
let hello5: NSAttributedString = "Hello".attributes.strikethrough(.styleSingle)
target 'MyApp' do
pod 'Attributes'
end
然后,在您的终端中或从 CocoaPods.app 运行 pod install
本项目受 MIT 许可证许可 - 有关详细信息,请参阅 LICENSE 文件