CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

QCAttributedStringBuilder 2.0.0

QCAttributedStringBuilder 2.0.0

Maintained by qingchuan.



  • By
  • zxqqingchuan

QCAttributedStringBuilder

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Feature

  • Builder 模式,支持链式调用。
  • 支持文字排版 RTL 模式。
  • 支持文字里嵌入 UIImageView, UIView, CALayer。
  • Attachment 依赖 YYText 实现。

Example

label.attributedText = QCAttributedString("abc")
    .color(.blue)
    .font(.systemFont(ofSize: 10))
    .alignment(.left)
    .append(", efg")
    .appendAttr(
        QCAttributedString(", emn")
            .color(.green)
            .build()
    )
    .firstSet(.red, of: "e")
    .firstReplace(
        "abc",
        with:
            QCAttributedString("cba")
            .color(.cyan)
            .font(.systemFont(ofSize: 20))
            .build()
    )
    .appendImage...
    .appendSpace...
    .appendRoundedLabel...
    .build()

Installation

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

pod 'QCAttributedStringBuilder'

Author

zxqqingchuan, [email protected]

License

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