Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bielikb/textattributes
TextAttributes provides type-safe API for setting text attributes for common UIKit components.
https://github.com/bielikb/textattributes
collection color font ios nsattributedstring uikit xcode
Last synced: about 8 hours ago
JSON representation
TextAttributes provides type-safe API for setting text attributes for common UIKit components.
- Host: GitHub
- URL: https://github.com/bielikb/textattributes
- Owner: bielikb
- License: mit
- Created: 2018-04-19T12:48:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-19T16:42:42.000Z (over 4 years ago)
- Last Synced: 2024-10-15T15:35:55.929Z (about 1 month ago)
- Topics: collection, color, font, ios, nsattributedstring, uikit, xcode
- Language: Swift
- Homepage:
- Size: 59.6 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# 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'
```