To run the example project, clone the repo, and run pod install
from the Example directory first.
- Builder 模式,支持链式调用。
- 支持文字排版 RTL 模式。
- 支持文字里嵌入 UIImageView, UIView, CALayer。
- Attachment 依赖 YYText 实现。
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()
QCAttributedStringBuilder is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'QCAttributedStringBuilder'
zxqqingchuan, [email protected]
QCAttributedStringBuilder is available under the MIT license. See the LICENSE file for more info.