All Projects → muukii → TypedTextAttributes

muukii / TypedTextAttributes

Licence: MIT license
🖍 The Library Creating Text Attributes with Type-Safety

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to TypedTextAttributes

Cupcake
An easy way to create and layout UI components for iOS (Swift version).
Stars: ✭ 273 (+396.36%)
Mutual labels:  nsattributedstring
Nsattributedstringbuilder
Composing NSAttributedString with SwiftUI-style syntax
Stars: ✭ 660 (+1100%)
Mutual labels:  nsattributedstring
Cjlabel
A drop-in replacement for UILabel that supports NSAttributedString, rich text, display any view, links, select copy and more
Stars: ✭ 140 (+154.55%)
Mutual labels:  nsattributedstring
Attributedstring
基于Swift插值方式优雅的构建富文本, 支持点击长按事件, 支持不同类型过滤, 支持自定义视图等.
Stars: ✭ 294 (+434.55%)
Mutual labels:  nsattributedstring
Nudein
An easy-to-use attributed text view for iOS Apps,use like masonry
Stars: ✭ 450 (+718.18%)
Mutual labels:  nsattributedstring
Gaudi
A swift theming framework for UIKit for easy adoption of multi theme and iOS dark mode
Stars: ✭ 36 (-34.55%)
Mutual labels:  nsattributedstring
Prestyler
Elegant text formatting tool in Swift 🔥
Stars: ✭ 36 (-34.55%)
Mutual labels:  nsattributedstring
AttributedStringWrapper
a simple packaging for NSAttributedString to make the developers easy to use
Stars: ✭ 16 (-70.91%)
Mutual labels:  nsattributedstring
Typeset
Deal with AttributedString efficiently
Stars: ✭ 458 (+732.73%)
Mutual labels:  nsattributedstring
Swiftyattributes
A Swifty API for attributed strings
Stars: ✭ 1,303 (+2269.09%)
Mutual labels:  nsattributedstring
Sjattributesfactory
Simplify operation NSAttributedString, make writing easier. Attributes String Editing Factory. iOS 富文本编辑, 让代码更清晰. 文本编辑, 高度计算, 正则匹配等待... 简便操作, 让你爽到爆!
Stars: ✭ 372 (+576.36%)
Mutual labels:  nsattributedstring
Commonmarkattributedstring
Create NSAttributedStrings from Markdown Text
Stars: ✭ 382 (+594.55%)
Mutual labels:  nsattributedstring
Allkit
🛠 Async List Layout Kit
Stars: ✭ 40 (-27.27%)
Mutual labels:  nsattributedstring
Transformer
Easy Attributed String Creator
Stars: ✭ 278 (+405.45%)
Mutual labels:  nsattributedstring
Bostring
Create NSAttributedString like a boss!
Stars: ✭ 193 (+250.91%)
Mutual labels:  nsattributedstring
CuteAttribute
An elegant way to deal with attributed string in swift.
Stars: ✭ 65 (+18.18%)
Mutual labels:  nsattributedstring
Atributika
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.
Stars: ✭ 845 (+1436.36%)
Mutual labels:  nsattributedstring
StringStylizer
Type strict builder class for NSAttributedString.
Stars: ✭ 75 (+36.36%)
Mutual labels:  nsattributedstring
Swiftrichstring
👩‍🎨 Elegant Attributed String composition in Swift sauce
Stars: ✭ 2,744 (+4889.09%)
Mutual labels:  nsattributedstring
Styledtextkit
Declarative building and fast rendering attributed string library.
Stars: ✭ 1,171 (+2029.09%)
Mutual labels:  nsattributedstring

🖍 TypedTextAttributes

Swift4 Release CocoaPods Carthage
Build Status Lincense

The Library Creating Text Attributes with Type-Safety
It will be helpful for creating NSAttributedString.

💡 TypedTextAttributes is inspired by TextAttributes.

Usage

It's very simple sample code.

let attributedString = "Hello".attributed {
  TextAttributes()
    .font(UIFont.preferredFont(forTextStyle: .headline))
    .foregroundColor(.white)
    .alignment(.right)
}

We can create text-attributes with method chaining. The methods are defined by extention for Dictionary<NSAttributedString.Key, Any> So, we can also describe following.

let baseAttributes = [NSAttributedString.Key : Any]()

let attributes = baseAttributes
  .foregroundColor(.white)
  .alignment(.right)

And, [NSAttributedString.Key : Any] has typealias as TextAttributes in this library.

The Methods adding attributes

  • font
  • foregroundColor
  • backgroundColor
  • underlineStyle
  • underlineColor
  • strikethroughStyle
  • strikethroughColor
  • strokeColor
  • strokeWidth
  • textEffect
  • link
  • baselineOffset
  • obliqueness
  • expansion
  • verticalGlyphForm
  • kern
  • paragraphStyle
  • alignment
  • firstLineHeadIndent
  • headIndent
  • tailIndent
  • lineHeightMultiple
  • maximumLineHeight
  • lineSpacing
  • paragraphSpacing
  • paragraphSpacingBefore
  • lineBreakMode
  • ligature
  • attachment
  • shadow

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate TypedTextAttributes into your Xcode project using CocoaPods, specify it in your Podfile:

target 'YourApp' do
  pod 'TypedTextAttributes'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate TypedTextAttributes into your Xcode project using Carthage, specify it in your Cartfile:

github "muukii/TypedTextAttributes"

Run carthage update to build the framework and drag the built TypedTextAttributes.framework into your Xcode project.

Author

muukii, [email protected]

License

TypedTextAttributes 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].