AttributedStyle 1.0.2

AttributedStyle 1.0.2

测试测试版
Lang语言 SwiftSwift
许可 MIT
发布最新发布2017年1月
SwiftSwift 版本3.0
SPM支持 SPM

Dima Pilipenko 维护。



  • 作者:
  • Pilipenko Dima

AttributedStyle

描述

  • 简单设置和重用
  • 几乎每个属性都可以作为函数使用
  • 紧凑的视图

示例

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 文件。