SwiftPM for creating AttributedString with Builder pattern or string literals.
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: