AttributedStyle 1.0.2

AttributedStyle 1.0.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jan 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Dima Pilipenko.



  • By
  • Pilipenko Dima

AttributedStyle

Description

  • easy setup and reusing
  • almost each attribute as function
  • compact view

Example

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.

Requirements

Swift 3

Installation

AttributedStyle is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "AttributedStyle"

Author

Pilipenko Dima, [email protected]

License

AttributedStyle is available under the MIT license. See the LICENSE file for more info.