A DSL for creating an NSAttributedString
. Original created to demonstrate function builders here.
Example:
NSAttributedString {
"Hello "
.foregroundColor(.blue)
"World"
.background(.orange)
.underline(.red, style: .thick)
}
You can install it via the Swift Package Manager in Xcode 11.
Go to File > Swift Packages > Add Package Dependency...
In the text field paste the following: https://github.com/carson-katri/AttributedStringBuilder
.
Available modifiers:
foregroundColor
background
underline
font
shadow
Feel free to add any that're missing.