All Projects → muukii → TextAttributesUtil

muukii / TextAttributesUtil

Licence: MIT License
Quickly create NSAttributedString with TextAttributes

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

TextAttributesUtil

CI Status Version License Platform Carthage compatible

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].