Skip to content

Instantly share code, notes, and snippets.

@veeneck
Created June 17, 2014 15:39
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 veeneck/8b9e03b53e2b0d5dfbc1 to your computer and use it in GitHub Desktop.
Save veeneck/8b9e03b53e2b0d5dfbc1 to your computer and use it in GitHub Desktop.
Swift Dispatch Async
class func loadSceneAssetsWithCompletionHandler(handler:()->()) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), {
MySprite.loadSharedAssets()
dispatch_async(dispatch_get_main_queue(), {
handler()
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment