AttributedStringBuilder

master

A DSL for creating NSAttributedStrings
carson-katri/AttributedStringBuilder

AttributedStringBuilder

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)
}

Installation

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.

Documentation

Available modifiers:

  • foregroundColor
  • background
  • underline
  • font
  • shadow

Feel free to add any that're missing.

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun Nov 13 2022 19:57:58 GMT-0500 (GMT-05:00)