TextAttributes

2.1.1

TextAttributes provides type-safe API for setting text attributes for common UIKit components.
bielikb/TextAttributes

What's New

Support iOS 9.0 and above

2020-04-19T16:42:42Z

Supports iOS 9.0+

TextAttributes

TextAttributes provides simple to use API for setting text attributes for common UIKit components.

TextAttributes allow you to forget about chunky NSAttributedString API == you don't have to remember the [NSAttributedStringKey: Any] or it's consecutive string keys (.font, .foregroundColor, .kern) and rather focus directly on styling.

Usage

let textAttributes = TextAttributes.attributes(font: Font.normalRegular, color: Color.white)
  • UILabel
label.textAttributes = textAttributes
  • UIButton
button.setAttributes(textAttributes, for: .normal)
  • UITextView
textView.textAttributes = textAttributes

Cocoapods

Add source

source 'https://github.com/bielikb/TextAttributes.git'
pod 'TextAttributes', '~> 1.0.1'

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Mar 11 2024 00:37:42 GMT-0900 (Hawaii-Aleutian Daylight Time)