Skip to content

Instantly share code, notes, and snippets.

@carson-katri
Created July 26, 2019 22:43
Show Gist options
  • Save carson-katri/437999e2bd6bac241a612ae66f6a3125 to your computer and use it in GitHub Desktop.
Save carson-katri/437999e2bd6bac241a612ae66f6a3125 to your computer and use it in GitHub Desktop.
@_functionBuilder
struct AttributedStringBuilder {
static func buildBlock(_ segments: NSAttributedString...) -> NSAttributedString {
let string = NSMutableAttributedString()
segments.forEach { string.append($0) }
return string
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment