TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jan 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by 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)
To run the example project, clone the repo, and run pod install
from the Example directory first.
Swift 3
AttributedStyle is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "AttributedStyle"
Pilipenko Dima, [email protected]
AttributedStyle is available under the MIT license. See the LICENSE file for more info.