Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
func dispatch_sync<R> (queue: dispatch_queue_t, block: Void -> R ) -> R {
var result: R!
dispatch_sync(queue) {
result = block()
return result
func result() -> String {
dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
return "something"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment