Latest 1.0.2
Homepage https://github.com/dimpiax/AttributedStyle
License MIT
Platforms ios 8.0
Authors

Language
Version
License
Platform

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.

Latest podspec

{
    "name": "AttributedStyle",
    "version": "1.0.2",
    "summary": "Swifty adaptation of NSAttributedStyle and NSParagraphStyle",
    "description": "# AttributedStylenSwifty adaptation of NSAttributedStyle and NSParagraphStylenn- easy setup and reusingn- almost each attribute as functionn- compact viewnn```swiftnlet attributedStyle = AttributedStyle().font(UIFont.systemFont(ofSize: 21, weight: UIFontWeightLight))nlet parapraphStyle = ParagraphStyle().lineBreakMode(.byTruncatingMiddle)nlet attributes = attributedStyle.paragraphStyle(parapraphStyle.style).foregroundColor(.gray).attributesnnlet label = UILabel()nlabel.attributedText = NSAttributedString(string: "Attribute it!", attributes: attributes)n// ornlabel.attributedText = NSAttributedString(string: "Attribute it!", attributes: AttributedStyle().font(UIFont.systemFont(ofSize: 21, weight: UIFontWeightLight)).foregroundColor(UIColor.darkGray).paragraphStyle(ParagraphStyle().alignment(.center).style).attributes)n```",
    "homepage": "https://github.com/dimpiax/AttributedStyle",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Pilipenko Dima": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dimpiax/AttributedStyle.git",
        "tag": "1.0.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "AttributedStyle/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This