Open Source Swift Library Providing A Nice Concise Syntax For Working With GCD

  •  
  •  
  •  
  •  
  •  

In the past I’ve mentioned a few resources simplifying the se of Grand Central Dispatch with Objective-C, but as of yet have not mentioned a helper library for working with GCD in Swift.

Here’s an open source library from TheHolyGrail providing a concise syntax for working with GCD using Swift language features.

KillerRabbit provides abstractions of the dispatch_, dispatch_queue, dispatch_block, dispatch_group, dispatch_source, and dispatch_semaphore APIs.

This snippet from the readme shows one could execute a few tasks asynchronously and wait indefinitely:

DispatchGroup().async(.Background) {
    doSomething(1)
}.async(.Utility) {
    doSomething(2)
}.async(.High) {
    doSomethingUrgently(3)
}.wait()

You can find KillerRabbit on Github here.

A nice library with a great syntax for working with GCD.


  •  
  •  
  •  
  •  
  •