Skip to content

Instantly share code, notes, and snippets.

@romainmenke
Last active September 15, 2015 02:24
Show Gist options
  • Save romainmenke/9f6aee5601adac4bac35 to your computer and use it in GitHub Desktop.
Save romainmenke/9f6aee5601adac4bac35 to your computer and use it in GitHub Desktop.
func highLight(string : String, completion: (finished: Bool) -> Void) {
let qualityOfServiceClass = QOS_CLASS_DEFAULT
let backgroundQueue = dispatch_get_global_queue(qualityOfServiceClass, 0)
dispatch_async(backgroundQueue) { () -> Void in
// actual syntax highlighting here
dispatch_sync(dispatch_get_main_queue()) { () -> Void in
completion(finished: true)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment