Skip to content

Instantly share code, notes, and snippets.

@malcommac
Created May 20, 2018 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malcommac/5c7ead5425ee4e0207439d52d82966ca to your computer and use it in GitHub Desktop.
Save malcommac/5c7ead5425ee4e0207439d52d82966ca to your computer and use it in GitHub Desktop.
let body: Style = Style { ... }
let big: Style = Style { ... }
let attributed: AttributedString = "hello ".set(style: body)
// the following code produce an attributed string by
// concatenating an attributed string and two plain string
// (one styled and another plain).
let attStr = attributed + "\(username)!".set(style:big) + ". You are welcome!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment