TextAttributesUtil 1.0.1

TextAttributesUtil 1.0.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2016
SPMSupports SPM

Maintained by muukii, muukii.



TextAttributesUtil

Quickly create NSAttributedString with TextAttributes

Usage

Before

let attributes = TextAttributes()
                    .font(UIFont.systemFontOfSize(14))
                    .alignment(.Center)
                    .foregroundColor(UIColor(white: 0.7, alpha: 1))

let attributedText = NSAttributedString(string: "Hello, NSAttributedText", attributes: attributes)

After

let attributedText = "Hello, NSAttributedText"
    .attributed {
        TextAttributes()
            .font(UIFont.systemFontOfSize(14))
            .alignment(.Center)
            .foregroundColor(UIColor(white: 0.7, alpha: 1))
    }

Installation

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

pod "TextAttributesUtil"

Author

muukii, [email protected]

License

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