测试测试版 | ✗ |
Lang语言 | SwiftSwift |
许可 | MIT |
发布最新发布 | 2017年1月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Dima Pilipenko 维护。
let attributedStyle = AttributedStyle().font(UIFont.systemFont(ofSize: 21, weight: UIFontWeightLight))
let parapraphStyle = ParagraphStyle().lineBreakMode(.byTruncatingMiddle)
let attributes = attributedStyle.paragraphStyle(parapraphStyle.style).foregroundColor(.gray).attributes
let label = UILabel()
label.attributedText = NSAttributedString(string: "Attribute it!", attributes: attributes)
// or
label.attributedText = NSAttributedString(string: "Attribute it!", attributes: AttributedStyle().font(UIFont.systemFont(ofSize: 21, weight: UIFontWeightLight)).foregroundColor(UIColor.darkGray).paragraphStyle(ParagraphStyle().alignment(.center).style).attributes)
要运行示例项目,请首先从仓库克隆,然后在示例目录中运行 `pod install`。
Swift 3
AttributedStyle 可通过 CocoaPods 获取。要安装它,只需简单地将以下行添加到您的 Podfile 中
pod "AttributedStyle"
Pilipenko Dima, [email protected]
AttributedStyle 在 MIT 许可下可用。更多信息请参阅 LICENSE 文件。