Last active
June 11, 2016 20:07
-
-
Save victoraugustolls/5b9d073b063acdae1fe37b2fd8efdd6e 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
public extension dispatch_queue_t { | |
final func async(block: dispatch_block_t) { | |
dispatch_async(self, block) | |
} | |
final func async(group: dispatch_group_t, _ block: dispatch_block_t) { | |
dispatch_group_async(group, self, block) | |
} | |
final func sync(block: dispatch_block_t) { | |
dispatch_sync(self, block) | |
} | |
} | |
// Usage like dispatch_get_main_queue().async { /* do stuff async */ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment