Skip to content

Instantly share code, notes, and snippets.

@romainmenke
Created September 14, 2015 20:27
Show Gist options
  • Save romainmenke/bde924edfc54ccc3aca2 to your computer and use it in GitHub Desktop.
Save romainmenke/bde924edfc54ccc3aca2 to your computer and use it in GitHub Desktop.
let highlightedString = NSMutableAttributedString(string: string)
for i in 0..<ranges.count {
highlightedString.addAttribute(NSForegroundColorAttributeName, value: UIColor.redColor(), range: ranges[i])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment