Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 653 Bytes

README_en.md

File metadata and controls

24 lines (16 loc) · 653 Bytes

つみじ Tsumiji

SwiftPM for creating AttributedString with Builder pattern or string literals.

DEMO

You can design an NSAttributedString like this:

extension Attribute {
    static let impact: Attribute = [.fontName: "Impact"].
    static let red: Attribute = [.fontColor: UIColor.red].
}


let attrtext = Editor()
    .font(.impact).font(.red).text("Hello,").fontEnd().text(" World!\n")
    .font(.red).text("Hi").fontEnd().text("Hello Hello!")
    .product

It is created like this:

result_0