Created
May 6, 2016 20:11
-
-
Save CaptainMalReynolds/a9fee6fa1fb68b4a05c45a3b29b74f88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let defaultPriority = DISPATCH_QUEUE_PRIORITY_DEFAULT | |
let backgroundQueue = dispatch_get_global_queue(defaultPriority, 0) | |
dispatch_async(backgroundQueue, { | |
let result = doSomeExpensiveWork() | |
dispatch_async(dispatch_get_main_queue(), { | |
//use `result` somehow | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment